Compilation fixes with recent compiler versions (GCC 13, clang 16).
[far2l.git] / WinPort / src / Backend / WX / ExclusiveHotkeys.h
bloba61b91c50a2d3211e53263ed66abbf697acb77fb
1 #pragma once
2 #include <wx/wx.h>
3 #include <cstdint>
5 class ExclusiveHotkeys
7 #ifdef __WXGTK__
8 typedef int (*gdk_keyboard_grab_t)(void *widget, int, uint32_t);
9 typedef int (*gdk_keyboard_ungrab_t)(uint32_t);
11 gdk_keyboard_grab_t _gdk_grab;
12 gdk_keyboard_ungrab_t _gdk_ungrab;
13 #endif
14 bool _ctrl_left, _ctrl_right, _alt_left, _alt_right, _win_left, _win_right;
15 bool _pending;
17 bool IsTriggeringKeyEvent(wxKeyEvent& event);
19 public:
20 ExclusiveHotkeys();
21 ~ExclusiveHotkeys();
23 bool Available() const;
25 //following methods are not not MT-safe
26 void SetTriggerKeys(bool ctrl_left, bool ctrl_right, bool alt_left, bool alt_right, bool win_left, bool win_right);
27 void OnKeyDown(wxKeyEvent& event, wxWindow *win);
28 void OnKeyUp(wxKeyEvent& event);
29 void Reset();