Robert Osfield wrote:
On 4/15/07, Eron Steger <[EMAIL PROTECTED]> wrote:
The problem isn't determining which keys are being held at any given
time, but the fact that a single key on the keyboard can be represented
by different results from the 'getKey' function.
Ideally for something like the 'a' key, I'd like to get the same result
from 'getKey()' whether or not shift (or alt or control) are held.
Since it appears that this is by design for 'getKey()', perhaps it makes
sense to add an additional method to osgGA::GUIEventAdapter that returns
a key code that provides a one-to-one mapping with individual keys.
The intrusive way to do this is add a separate getKeyCode into
osgGA::GUIEventAdapter.
The non intrusive way to do it would be to create a std::map or vector
that remaps the separate keys to the keycodes you want.
Might do the equivalent of the non-intrusive way for now, however it's
probably appropriate to have a 'getKeyCode' function in this case.
Consider someone pressing the numpad key '4', with numlock on. In this
case, 'getKey()' returns '4'. However, the program wouldn't have a way
of determining whether that keypress was on the numpad or on the numbers
above the letters.
If the program could get only one piece of information from the library,
getting the key code makes more sense since you can always go from that
to the associated character, whereas the reverse is not true.
- Eron
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/