MapANSI()
Synopsis
LONG MapANSI(
STRPTR string,
LONG count,
STRPTR buffer,
LONG length,
struct KeyMap * keyMap );
Function
Convert an ANSI byte string to rawkey codes
Result
actual - the number of code/qualifier pairs this function
generated in buffer. Or an negative value to indicate
an error.
MapRawKey()
Synopsis
WORD MapRawKey(
struct InputEvent * event,
STRPTR buffer,
LONG length,
struct KeyMap * keyMap );
Function
Converts IECLASS_RAWKEY events to ANSI bytes.
The event list (event->ie_NextEvent) is not traversed!
Result
Actual number of chars written to the buffer. A return value of
-1 means buffer owerflow.
SetKeyMapDefault()
Synopsis
void SetKeyMapDefault(
struct KeyMap * keyMap );
Function
Sets the systemwide default keymap.
Notes
- This function should only be used by a keymap preferences editor.
- Once you have set the keymap, you should NEVER deallocate it, as
other apps might have got pointers to it via AskKeyMapDefault().
- You should use the keymap.resource to check if the keymap has allready
been added. If not, then remember to arbitrate before adding it to
the keymap.resource list of keymaps.
Bugs
When adding the keymap to the keymap.resource one must use
Forbid()/Permit() to arbitrate. Ideally one should use semaphores,
but the keymap.resource contains no semaphore for this purpose.