[fixed] EKEY_CODE in Keycodes.h has insufficient range
Posted: Thu Mar 16, 2017 9:58 am
Enum EKEY_CODE for keyeboard input accepts only 255 codes.
Problem:
Presses of 'fn' button on notebook keyboard yields code 255. As far as KEY_KEY_CODES_COUNT = 0xff is used for KeyIsDown[KEY_KEY_CODES_COUNT]; the value ends in next variable. (In my case it was left mouse button clicked)
Suggested fix:
Add fn key to the enum. Variable will support complete 8b input.
Problem:
Presses of 'fn' button on notebook keyboard yields code 255. As far as KEY_KEY_CODES_COUNT = 0xff is used for KeyIsDown[KEY_KEY_CODES_COUNT]; the value ends in next variable. (In my case it was left mouse button clicked)
Code: Select all
//problem
bool KeyIsDown[255];
KeyIsDown[255] = true; // problem here
Add fn key to the enum. Variable will support complete 8b input.
Code: Select all
KEY_FN = 0xFF, // Function key on notebook
KEY_KEY_CODES_COUNT = 0x100 // this is not a key, but the amount of keycodes there are.