Key state interface. More...
#include <IKeyState.h>
Inherits IInterface.
Inherited by CKeyState, and IPlatformScreen.
Classes | |
| class | CKeyInfo |
| Key event data. More... | |
Public Types | |
| enum | { kNumButtons = 0x200 } |
| typedef std::set< KeyButton > | KeyButtonSet |
Public Member Functions | |
| IKeyState (IEventQueue &eventQueue) | |
manipulators | |
| virtual void | updateKeyMap ()=0 |
| Update the keyboard map. | |
| virtual void | updateKeyState ()=0 |
| Update the key state. | |
| virtual void | setHalfDuplexMask (KeyModifierMask)=0 |
| Set half-duplex mask. | |
| virtual void | fakeKeyDown (KeyID id, KeyModifierMask mask, KeyButton button)=0 |
| Fake a key press. | |
| virtual bool | fakeKeyRepeat (KeyID id, KeyModifierMask mask, SInt32 count, KeyButton button)=0 |
| Fake a key repeat. | |
| virtual bool | fakeKeyUp (KeyButton button)=0 |
| Fake a key release. | |
| virtual void | fakeAllKeysUp ()=0 |
| Fake key releases for all fake pressed keys. | |
| virtual bool | fakeCtrlAltDel ()=0 |
| Fake ctrl+alt+del. | |
Protected Member Functions | |
| IEventQueue & | getEventQueue () const |
accessors | |
|
| |
| virtual bool | isKeyDown (KeyButton) const =0 |
| Test if key is pressed. | |
| virtual KeyModifierMask | getActiveModifiers () const =0 |
| Get the active modifiers. | |
| virtual KeyModifierMask | pollActiveModifiers () const =0 |
| Get the active modifiers from OS. | |
| virtual SInt32 | pollActiveGroup () const =0 |
| Get the active keyboard layout from OS. | |
| virtual void | pollPressedKeys (KeyButtonSet &pressedKeys) const =0 |
| Get the keys currently pressed from OS. | |
| CEvent::Type | getKeyDownEvent () |
| Get key down event type. Event data is CKeyInfo*, count == 1. | |
| CEvent::Type | getKeyUpEvent () |
| Get key up event type. Event data is CKeyInfo*, count == 1. | |
| CEvent::Type | getKeyRepeatEvent () |
| Get key repeat event type. Event data is CKeyInfo*. | |
| static CEvent::Type | getKeyDownEvent (IEventQueue &eventQueue) |
| Get key down event type. Event data is CKeyInfo*, count == 1. | |
| static CEvent::Type | getKeyUpEvent (IEventQueue &eventQueue) |
| Get key up event type. Event data is CKeyInfo*, count == 1. | |
| static CEvent::Type | getKeyRepeatEvent (IEventQueue &eventQueue) |
| Get key repeat event type. Event data is CKeyInfo*. | |
Key state interface.
This interface provides access to set and query the keyboard state and to synthesize key events.
Definition at line 34 of file IKeyState.h.
| virtual void IKeyState::fakeAllKeysUp | ( | ) | [pure virtual] |
Fake key releases for all fake pressed keys.
Synthesizes a key release event for every key that is synthetically pressed and updates the key state.
Implemented in CMSWindowsScreen, CKeyState, CPlatformScreen, and IPlatformScreen.
Referenced by CPlatformScreen::fakeAllKeysUp().
| virtual bool IKeyState::fakeCtrlAltDel | ( | ) | [pure virtual] |
Fake ctrl+alt+del.
Synthesize a press of ctrl+alt+del. Return true if processing is complete and false if normal key processing should continue.
Implemented in CMSWindowsKeyState, COSXKeyState, CXWindowsKeyState, CKeyState, CPlatformScreen, and IPlatformScreen.
Referenced by CPlatformScreen::fakeCtrlAltDel().
| virtual void IKeyState::fakeKeyDown | ( | KeyID | id, | |
| KeyModifierMask | mask, | |||
| KeyButton | button | |||
| ) | [pure virtual] |
Fake a key press.
Synthesizes a key press event and updates the key state.
Implemented in CMSWindowsKeyState, CMSWindowsScreen, CKeyState, CPlatformScreen, and IPlatformScreen.
Referenced by CPlatformScreen::fakeKeyDown().
| virtual bool IKeyState::fakeKeyRepeat | ( | KeyID | id, | |
| KeyModifierMask | mask, | |||
| SInt32 | count, | |||
| KeyButton | button | |||
| ) | [pure virtual] |
Fake a key repeat.
Synthesizes a key repeat event and updates the key state.
Implemented in CMSWindowsKeyState, CMSWindowsScreen, CKeyState, CPlatformScreen, and IPlatformScreen.
Referenced by CPlatformScreen::fakeKeyRepeat().
| virtual bool IKeyState::fakeKeyUp | ( | KeyButton | button | ) | [pure virtual] |
Fake a key release.
Synthesizes a key release event and updates the key state.
Implemented in CMSWindowsScreen, CKeyState, CPlatformScreen, and IPlatformScreen.
Referenced by CPlatformScreen::fakeKeyUp().
| virtual KeyModifierMask IKeyState::getActiveModifiers | ( | ) | const [pure virtual] |
Get the active modifiers.
Returns the modifiers that are currently active according to our shadowed state.
Implemented in CKeyState, CPlatformScreen, and IPlatformScreen.
Referenced by CPlatformScreen::getActiveModifiers().
| virtual bool IKeyState::isKeyDown | ( | KeyButton | ) | const [pure virtual] |
Test if key is pressed.
Returns true iff the given key is down. Half-duplex toggles always return false.
Implemented in CKeyState, CPlatformScreen, and IPlatformScreen.
Referenced by CPlatformScreen::isKeyDown().
| virtual SInt32 IKeyState::pollActiveGroup | ( | ) | const [pure virtual] |
Get the active keyboard layout from OS.
Returns the active keyboard layout according to the operating system.
Implemented in CMSWindowsKeyState, COSXKeyState, CXWindowsKeyState, CKeyState, CPlatformScreen, and IPlatformScreen.
Referenced by CPlatformScreen::pollActiveGroup().
| virtual KeyModifierMask IKeyState::pollActiveModifiers | ( | ) | const [pure virtual] |
Get the active modifiers from OS.
Returns the modifiers that are currently active according to the operating system.
Implemented in CMSWindowsKeyState, COSXKeyState, CXWindowsKeyState, CKeyState, CPlatformScreen, and IPlatformScreen.
Referenced by CPlatformScreen::pollActiveModifiers().
| virtual void IKeyState::pollPressedKeys | ( | KeyButtonSet & | pressedKeys | ) | const [pure virtual] |
Get the keys currently pressed from OS.
Adds any keys that are currently pressed according to the operating system to pressedKeys.
Implemented in CMSWindowsKeyState, COSXKeyState, CXWindowsKeyState, CKeyState, CPlatformScreen, and IPlatformScreen.
Referenced by CPlatformScreen::pollPressedKeys().
| virtual void IKeyState::setHalfDuplexMask | ( | KeyModifierMask | ) | [pure virtual] |
Set half-duplex mask.
Sets which modifier toggle keys are half-duplex. A half-duplex toggle key doesn't report a key release when toggled on and doesn't report a key press when toggled off.
Implemented in CKeyState, CPlatformScreen, and IPlatformScreen.
Referenced by CPlatformScreen::setHalfDuplexMask().
| virtual void IKeyState::updateKeyMap | ( | ) | [pure virtual] |
Update the keyboard map.
Causes the key state to get updated to reflect the current keyboard mapping.
Implemented in CKeyState, CPlatformScreen, and IPlatformScreen.
Referenced by CPlatformScreen::updateKeyMap().
| virtual void IKeyState::updateKeyState | ( | ) | [pure virtual] |
Update the key state.
Causes the key state to get updated to reflect the physical keyboard state.
Implemented in CKeyState, CPlatformScreen, and IPlatformScreen.
Referenced by CPlatformScreen::updateKeyState().
1.7.1