HotKey API: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| Line 20: | Line 20: | ||
* byte '''KeyIndex''' - OpenGL key enumeration | * byte '''KeyIndex''' - OpenGL key enumeration | ||
* byte '''KeyFlags''' - see enumeration above | * byte '''KeyFlags''' - see enumeration above | ||
{{Category:Protocol Extensions}} | |||
Revision as of 03:59, 9 July 2011
A simple way to get key press information from the client.
KeyFlags enumeration
Enumeration used to indicate what modifiers were on when the key was pressed or released.
[Flags] enum KeyFlags {
None = 0,
Ctrl = 1,
Alt = 2,
Shift = 4,
CapsLock = 8
}
KeyPressed packet (Client -> Server)
- byte OpCode
- byte KeyIndex - OpenGL key enumeration
- byte KeyFlags - see enumeration above
KeyReleased packet (Client -> Server)
- byte OpCode
- byte KeyIndex - OpenGL key enumeration
- byte KeyFlags - see enumeration above
Data Types
- sbyte = signed byte
- byte = unsigned byte (extension)
- short = signed 16-bit int, big-endian
- ushort = unsigned 16-bit int, big-endian (extension)
- RGB = red-green-blue triplet. 1 unsigned byte per channel, 3 bytes total (extension)
- RGBA = red-green-blue triplet + alpha. 1 unsigned byte per channel, 4 bytes total (extension)