mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 04:10:06 +00:00 
			
		
		
		
	Add hotkey manager
This commit is contained in:
		
							parent
							
								
									3da1d15470
								
							
						
					
					
						commit
						2c63b4e387
					
				
					 3 changed files with 150 additions and 0 deletions
				
			
		
							
								
								
									
										43
									
								
								scwx-qt/source/scwx/qt/manager/hotkey_manager.hpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								scwx-qt/source/scwx/qt/manager/hotkey_manager.hpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,43 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <scwx/qt/types/hotkey_types.hpp> | ||||
| 
 | ||||
| #include <memory> | ||||
| 
 | ||||
| #include <QObject> | ||||
| 
 | ||||
| class QKeyEvent; | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace qt | ||||
| { | ||||
| namespace manager | ||||
| { | ||||
| 
 | ||||
| class HotkeyManager : public QObject | ||||
| { | ||||
|    Q_OBJECT | ||||
|    Q_DISABLE_COPY_MOVE(HotkeyManager) | ||||
| 
 | ||||
| public: | ||||
|    explicit HotkeyManager(); | ||||
|    ~HotkeyManager(); | ||||
| 
 | ||||
|    void HandleKeyPress(QKeyEvent* event); | ||||
|    void HandleKeyRelease(QKeyEvent* event); | ||||
| 
 | ||||
|    static std::shared_ptr<HotkeyManager> Instance(); | ||||
| 
 | ||||
| signals: | ||||
|    void HotkeyPressed(scwx::qt::types::Hotkey hotkey); | ||||
|    void HotkeyReleased(scwx::qt::types::Hotkey hotkey); | ||||
| 
 | ||||
| private: | ||||
|    class Impl; | ||||
|    std::unique_ptr<Impl> p; | ||||
| }; | ||||
| 
 | ||||
| } // namespace manager
 | ||||
| } // namespace qt
 | ||||
| } // namespace scwx
 | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat