mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-15 23:49:55 +00:00
c11fe6788f
(Shift)Tab cycles, arrow keys move to the next button in that direction, Enter/Space accepts. Note: Unless MyGUI is hacked to bits, clicking on an empty space will annoyingly reset the key focus. Not sure how to deal with that yet. The visual highlight for selected buttons requires MyGUI commit 632d007429d0bf0c7d7f6c5db4a08353a63dd839 or later to appear (to be released in 3.2.3).
27 lines
526 B
C++
27 lines
526 B
C++
#ifndef OPENMW_MWGUI_KEYBOARDNAVIGATION_H
|
|
#define OPENMW_MWGUI_KEYBOARDNAVIGATION_H
|
|
|
|
#include <MyGUI_KeyCode.h>
|
|
|
|
namespace MWGui
|
|
{
|
|
|
|
class KeyboardNavigation
|
|
{
|
|
public:
|
|
KeyboardNavigation();
|
|
~KeyboardNavigation();
|
|
|
|
/// @return Was the key handled by this class?
|
|
bool injectKeyPress(MyGUI::KeyCode key, unsigned int text);
|
|
|
|
private:
|
|
bool switchFocus(int direction, bool wrap);
|
|
|
|
/// Send button press event to focused button
|
|
bool accept();
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|