aboutsummaryrefslogtreecommitdiff
path: root/main/enigma.cpp
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2007-06-26 23:02:31 +0000
committerFelix Domke <tmbinc@elitedvb.net>2007-06-26 23:02:31 +0000
commit40ba45345d3300c20f82fc8ddaf23b8913836806 (patch)
tree2e852720a421db18086801dcbea3d4de8264377a /main/enigma.cpp
parent6ae5817707cf77c29ff070e76791cc4816946ec4 (diff)
downloadenigma2-40ba45345d3300c20f82fc8ddaf23b8913836806.tar.gz
enigma2-40ba45345d3300c20f82fc8ddaf23b8913836806.zip
support for 'long keypresses' ('l' in keymap.xml flags)
Diffstat (limited to 'main/enigma.cpp')
-rw-r--r--main/enigma.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/main/enigma.cpp b/main/enigma.cpp
index eb0a1845..19e66756 100644
--- a/main/enigma.cpp
+++ b/main/enigma.cpp
@@ -58,8 +58,26 @@ int getPrevAsciiCode()
void keyEvent(const eRCKey &key)
{
+ static eRCKey last(0, 0, 0);
+ static int num_repeat;
+
ePtr<eActionMap> ptr;
eActionMap::getInstance(ptr);
+
+ if ((key.code == last.code) && (key.producer == last.producer) && key.flags & eRCKey::flagRepeat)
+ num_repeat++;
+ else
+ {
+ num_repeat = 0;
+ last = key;
+ }
+
+ if (num_repeat == 4)
+ {
+ ptr->keyPressed(key.producer->getIdentifier(), key.code, eRCKey::flagLong);
+ num_repeat++;
+ }
+
if (key.flags & eRCKey::flagAscii)
{
prev_ascii_code = key.code;