Possible bug in on_key_press

Started by dreammaster, Wed 27/10/2004 01:24:58

Previous topic - Next topic

dreammaster

Hi there,

Whilst working on keyboard control for a custom save/restore dialog in my game, I noticed that the keycodes for the small area of the keyboard that contains the Ins/Del/Home/End/PgUp/PgDn keys (not the numeric keypad) seem to have a weird effect with the global on_key_press method.. not all the values map to the values the help file says they should.

The Page Up button is particularly noticable, in that it maps to 380, which is the key for the down arrow. I tried putting the following line at the start of the global on_key_press:
Ã,  Ã,  Display("%d %d", keycode, IsKeyPressed(keycode));

It showed that whilst several of the keys mapped to the correct value, only one of them returned 1 for the IsKeyPressed check. So what I'm wondering is why this happens.. is it a bug, or is it intended? And if it's intended, then why?

Hellomoto

The key list shown in the AGS manual is the key_codeing as used by the majority of keyboards, this might mean that your keyboard is not configured in the same way, that this list is set, I do not know where a key code list is held on your computer, but try looking on the settings for your keyboard. I might be wrong however.

Pumaman

The manual doesn't actually mention any codes for that block of keys (it only talks about the ones on the numeric keypad).

It's probably just that I never set up the mapping in AGS for those 6 keys, since to my knowledge nobody has wanted to use them in an AGS game yet. If it's something that poses you a problem, I can properly add support for those keys into the engine.

SMF spam blocked by CleanTalk