Platforms to show: All Mac Windows Linux Cross-Platform
Back to KeyCodesMBS class.
KeyCodesMBS.AsciiToKeyCode(ascii as Integer) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Remote Control | MBS ComputerControl Plugin | 2.8 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
You get the main key, not any modifier which may also be pressed.
Some examples using this method:
KeyCodesMBS.KeyCodeToAscii(keycode as Integer) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Remote Control | MBS ComputerControl Plugin | 2.8 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Note on a Mac:
Bit 0 to 6 are the keycode, bit 7 is 1 if key goes up and 0 if key goes down.
Bit 8 to 15 are modifier keys:
Constants for the modifier keys:
shiftKey | 512 | shift key down? |
alphaLock | 1024 | alpha lock down? |
optionKey | 2048 | option key down? |
controlKey | 4096 | control key down? |
rightShiftKey | 8192 | right shift key down? |
rightOptionKey | 16384 | right Option key down? |
rightControlKey | 32768 | right Control key down? |
Not available in 64-bit.
See MacTextForKeyCode method in RemoteControlMBS module.
KeyCodesMBS.KeyCodeToAsciiWithSecondKeyCode(keycode as Integer) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Remote Control | MBS ComputerControl Plugin | 3.1 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
On the first call of KeyCodeToAscii you get the ASCII char, but if you call KeyCodeToAsciiWithSecondKeyCode and the state property is not changed, you can get what the user gets if he presses several keys.
KeyCodeToAscii resets state to 0 before calling.
On Windows, KeyCodeToAscii and KeyCodeToAsciiWithSecondKeyCode are equal.
Note on a Mac:
Bit 0 to 6 are the keycode, bit 7 is 1 if key goes up and 0 if key goes down.
Bit 8 to 15 are modifier keys:
Constants for the modifier keys:
shiftKey | 512 | shift key down? |
alphaLock | 1024 | alpha lock down? |
optionKey | 2048 | option key down? |
controlKey | 4096 | control key down? |
rightShiftKey | 8192 | right shift key down? |
rightOptionKey | 16384 | right Option key down? |
rightControlKey | 32768 | right Control key down? |
Not available in 64-bit.
KeyCodesMBS.TestForAsciiKeyDown(ascii as Integer) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Remote Control | MBS ComputerControl Plugin | 2.8 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
KeyCodesMBS.TestForKeyDown(keycode as Integer) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Remote Control | MBS ComputerControl Plugin | 2.8 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Some examples using this method:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Remote Control | MBS ComputerControl Plugin | 2.8 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
The items on this page are in the following plugins: MBS ComputerControl Plugin.