Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
SingleKeyPressMonitor.h
00001 #ifndef SINGLE_KEY_PRESS_MONITOR_H_ 00002 #define SINGLE_KEY_PRESS_MONITOR_H_ 00003 00004 #include "kbd_mgr/KeyPressEventServer.h" 00005 #include "kbd_mgr/KeyboardStateHandler.h" 00006 00007 namespace kbd_mgr { 00008 00009 /** 00010 * @brief A keyboard state change handler that reports on single keypresses. 00011 * It voluntarily ignores key combinations (only the first key pressed in a combo is reported). 00012 */ 00013 class SingleKeyPressMonitor : public KeyPressEventServer, public KeyboardStateHandler { 00014 public: 00015 SingleKeyPressMonitor() : 00016 lastReportedState(), lastReportedKey(KeyEvent::NoKey) 00017 { } 00018 00019 virtual void handleState(const KeyboardState &newState); 00020 00021 private: 00022 KeyboardState lastReportedState; 00023 int lastReportedKey; 00024 }; 00025 00026 } // kbd_mgr 00027 00028 #endif // SINGLE_KEY_PRESS_MONITOR_H_
Generated on Wed Jul 13 2022 16:23:43 by
1.7.2