Re: [AD] key scan codes have changed? |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> > You did read the documentation there right? Where did it ever say you
could
> > test directly against the returned integer? In all cases, it says to
pull the
> > words apart and then test.
>
>
> how is pulling a word apart any diffrent from testing it whole ?
It's not the pulling it apart that does it, it's comparing against the
KEY_* constants versus a hard-coded integer.
> so if i want to test all the possible keys, i would have to write out
> each KEY_*
>
> if ((val >> 8) == KEY_SPACE) myCode(' ');
> if ((val >> 8) == KEY_A) myCode('a');
> ..etc..
>
>
> ???
> is that the recommended way to do it ?
Almost. The recommended way to do what you post there would be to use
scancode_to_ascii() or scancode_to_name() (yes, that is a polite way of
saying RTFM ;)).
Any of Allegro's examples using those functions, by the way?
Evert