Duplicate Keycode name

Archives Forums/BlitzMax Bug Reports/Duplicate Keycode name

Brucey(Posted 2014) [#1]
Looking at keycodes.h I noticed there are two number pad keys defined with very similar names :
	KEY_NUM0=96,KEY_NUM1,KEY_NUM2,KEY_NUM3,KEY_NUM4,
	KEY_NUM5,KEY_NUM6,KEY_NUM7,KEY_NUM8,KEY_NUM9,
	KEY_NUMMULTIPLY=106,KEY_NUMADD,KEY_NUMSLASH,
	KEY_NUMSUBTRACT,KEY_NUMDECIMAL,KEY_NUMDIVIDE,

KEY_NUMSLASH and KEY_NUMDIVIDE.

Also, the number pad EQUALS key is missing?

In keycodes.bmx, 108 is missing, which corresponds with KEY_NUMSLASH. Should this be EQUALS?
Or is equals missed out because there is already an equals key elsewhere on the keyboard?


Henri(Posted 2014) [#2]
I would hazard a guess that the EQUELS key is already defined elsewhere (keydown data=48). On my keyboard it's not in the numpad, but in KEY_0.

Keycode 108 doesn't seem to exist (I tried every key)

-Henri


Derron(Posted 2014) [#3]
Maybe because "KEY_NUMSLASH" would only exist on specific keyboard layouts.

This is what I have on MY keyboard:

[numlock] [divide] [multiply] [ minus ]
[   7   ] [   8  ] [   9    ] ,-------,
[   4   ] [   5  ] [   6    ] |___+___|
[   1   ] [   2  ] [   3    ] ,-------,
[        0       ] [   ,    ] |_ENTER_|


I just cannot imagine a case needing a "Slash" ... numpads are for accountants, so they need everything to enter simple calculations (in Germany the ". / Del"-Key is ", Entf" because our delimeter is "," instead of ".") - that is why the keycode is called "NUMDECIMAL".



Javascript defines keycodes this way:
http://unixpapa.com/js/key.html

According to this, the numberes used in BlitzMax are the same, Mozilla and Internet Explorer use:

KEY            CODE
. Del           110
0 Ins            96
1 End            97
2 down-arrow     98
3 Pg Dn          99
4 left-arrow    100
5               101
6 right-arrow   102
7 Home          103
8 up-arrow      104
9 Pg Up         105
+               107
-               109
*               106
/               111


See -- 108 is not used.


SO: "KEY_NUMSLASH" is just ... obsolete or never existed. Maybe it was inteded as "equal" to "KEY_NUMDIVIDE"
But because signs might differ, it got removed:
ENGLISH   GERMAN
   /        ·
  /       -----
 /          ·



bye
Ron