Difference between revisions of "EditMBStringChar"
From WikiPrizm
Jump to navigationJump to searchLine 4: | Line 4: | ||
| index = 0x1224 | | index = 0x1224 | ||
| signature = int EditMBStringChar(unsigned char* MB_string, int posmax, int xpos, int char_to_insert) | | signature = int EditMBStringChar(unsigned char* MB_string, int posmax, int xpos, int char_to_insert) | ||
− | | synopsis = Edits a multi-byte string according to the specified character key (where the GetKey code is lower than 30000) and cursor position. To be used in conjunction with [[DisplayMBString]] and [[EditMBStringCtrl]]. | + | | synopsis = Edits a [[Multi-byte_strings|multi-byte string]] according to the specified character key (where the GetKey code is lower than 30000) and cursor position. To be used in conjunction with [[DisplayMBString]] and [[EditMBStringCtrl]]. |
| parameters = * '''MB_string''' - pointer to multi-byte string to edit. Must not be constant, as this syscall will modify the string contents, inserting a character. | | parameters = * '''MB_string''' - pointer to multi-byte string to edit. Must not be constant, as this syscall will modify the string contents, inserting a character. | ||
* '''posmax''' - maximum size, in bytes, the string can take; the size of the buffer '''MB_string''' points to should be taken into account, to avoid buffer overflows. | * '''posmax''' - maximum size, in bytes, the string can take; the size of the buffer '''MB_string''' points to should be taken into account, to avoid buffer overflows. |
Latest revision as of 08:07, 4 August 2014
Contents
Synopsis
Header: fxcg/keyboard.h
Syscall index: 0x1224
Function signature: int EditMBStringChar(unsigned char* MB_string, int posmax, int xpos, int char_to_insert)
Edits a multi-byte string according to the specified character key (where the GetKey code is lower than 30000) and cursor position. To be used in conjunction with DisplayMBString and EditMBStringCtrl.
Parameters
- MB_string - pointer to multi-byte string to edit. Must not be constant, as this syscall will modify the string contents, inserting a character.
- posmax - maximum size, in bytes, the string can take; the size of the buffer MB_string points to should be taken into account, to avoid buffer overflows.
- xpos - current cursor position (see the DisplayMBString cursor parameter).
- char_to_insert -the GetKey code of the character key pressed.
Returns
The new cursor position - set the variable used on the xpos parameter to this value to advance the cursor.
Comments
This syscall is for when a character key is pressed during text editing. If the key pressed is not a character key, or in other words, if the GetKey code is equal or higher than 30000, use EditMBStringCtrl instead.