NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
niftkWindowsHotkeyHandler.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef niftkWindowsHotkeyHandler_h
16 #define niftkWindowsHotkeyHandler_h
17 
18 #include <niftkCoreGuiExports.h>
19 #include <QThread>
20 
21 namespace niftk
22 {
23 
24 // pimpl to hide all the nasty windows internals.
25 struct WindowsHotkeyHandlerImpl;
26 
34 class NIFTKCOREGUI_EXPORT WindowsHotkeyHandler : public QThread
35 {
36  Q_OBJECT
37 
38 public:
39 
44  enum Hotkey
45  {
46  CTRL_ALT_F5 = 0x00030074 // VK_F5 | ((MOD_ALT | MOD_CONTROL) << 16)
47  , CTRL_ALT_F6 = 0x00030075 // VK_F6 | ((MOD_ALT | MOD_CONTROL) << 16)
48  , CTRL_ALT_F7 = 0x00030076 // VK_F7 | ((MOD_ALT | MOD_CONTROL) << 16)
49  };
50 
51 
62  WindowsHotkeyHandler(Hotkey hk);
63  virtual ~WindowsHotkeyHandler();
64 
65 signals:
66 
70  void HotkeyPressed(niftk::WindowsHotkeyHandler*, int);
71 
72 protected:
73 
79  virtual void run();
80 
81 private:
83  WindowsHotkeyHandler& operator=(const WindowsHotkeyHandler& assignme);
84 
85 
86  WindowsHotkeyHandlerImpl* m_Pimpl;
87  Hotkey m_Hotkey;
88  volatile bool m_ShouldQuit;
89 };
90 
91 } // end namespace
92 
93 #endif // niftkWindowsHotkeyHandler_h
Definition: niftkWindowsHotkeyHandler.h:34
Definition: niftkWindowsHotkeyHandler.cxx:31
Hotkey
Definition: niftkWindowsHotkeyHandler.h:44
Definition: niftkExceptionObject.h:21