mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-15 23:49:55 +00:00
5f440a29bd
Among other things, this will remember the focused button in the container window, allowing quick looting of multiple containers.
35 lines
763 B
C++
35 lines
763 B
C++
#ifndef OPENMW_MWGUI_KEYBOARDNAVIGATION_H
|
|
#define OPENMW_MWGUI_KEYBOARDNAVIGATION_H
|
|
|
|
#include <MyGUI_KeyCode.h>
|
|
#include <MyGUI_IUnlinkWidget.h>
|
|
|
|
namespace MWGui
|
|
{
|
|
|
|
class KeyboardNavigation : public MyGUI::IUnlinkWidget
|
|
{
|
|
public:
|
|
KeyboardNavigation();
|
|
~KeyboardNavigation();
|
|
|
|
/// @return Was the key handled by this class?
|
|
bool injectKeyPress(MyGUI::KeyCode key, unsigned int text);
|
|
|
|
void saveFocus(int mode);
|
|
void restoreFocus(int mode);
|
|
|
|
void _unlinkWidget(MyGUI::Widget* widget);
|
|
|
|
private:
|
|
bool switchFocus(int direction, bool wrap);
|
|
|
|
/// Send button press event to focused button
|
|
bool accept();
|
|
|
|
std::map<int, MyGUI::Widget*> mKeyFocus;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|