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.cpp
00001 #include "kbd_mgr/SingleKeyPressMonitor.h" 00002 00003 namespace kbd_mgr { 00004 00005 void SingleKeyPressMonitor::handleState(const KeyboardState &newState) 00006 { 00007 int key; 00008 if (newState.getKeyPressType(key) == KeyboardState::SingleKeyPress && this->lastReportedState.empty()) 00009 { 00010 KeyEvent keyDown(key, KeyEvent::KeyDown); 00011 invokeHandler(keyDown); 00012 00013 this->lastReportedState = newState; 00014 this->lastReportedKey = key; 00015 } 00016 else if (!this->lastReportedState.empty() && 00017 (newState & this->lastReportedState).empty()) 00018 { 00019 KeyEvent keyUp(this->lastReportedKey, KeyEvent::KeyUp); 00020 invokeHandler(keyUp); 00021 00022 this->lastReportedState.clear(); 00023 this->lastReportedKey = KeyEvent::NoKey; 00024 } 00025 00026 } 00027 00028 } // kbd_mgr
Generated on Wed Jul 13 2022 16:23:43 by
 1.7.2