void eRCDeviceDreambox2::handleCode(int rccode) { /*eDebug("eRCDeviceDreambox2::handleCode rccode=%d 0x%x", rccode, rccode);*/ if (rccode == 0x00FF) /* break code */ { timeout.stop(); repeattimer.stop(); timeOut(); return; } timeout.start(1500, 1); int old = ccode; ccode = rccode; if ((old != -1) && (((old & 0x7FFF) != (rccode & 0x7FFF)) || !(rccode & 0x8000))) { repeattimer.stop(); /*emit*/ input->keyPressed(eRCKey(this, getKeyCode(old&0x7FFF), eRCKey::flagBreak)); } if ((old^rccode)&0x7FFF) { input->keyPressed(eRCKey(this, getKeyCode(rccode&0x7FFF), 0)); } else if (rccode&0x8000 && !repeattimer.isActive()) { repeattimer.start(getRepeatDelay(), 1); } }
void eRCDeviceDreamboxButton::handleCode(int code) { code = (~code) & 0x7; int l = last; last = code; for (int i = 0; i < 4; i++) { if ((l & ~code) & (1 << i)) { /*emit*/ input->keyPressed(eRCKey(this, getKeyCode(i), eRCKey::flagBreak)); } else if ((~l & code) & (1 << i)) { /*emit*/ input->keyPressed(eRCKey(this, getKeyCode(i), 0)); } } if (code) { repeattimer.start(getRepeatDelay(), 1); } else { repeattimer.stop(); } }
void eLircInputDevice::handleCode(long arg) { const lircEvent* event = (const lircEvent*)arg; int code, flags; if (event->repeat == true) { flags = eRCKey::flagRepeat; } else if (event->release == true) { flags = eRCKey::flagBreak; } else { flags = eRCKey::flagMake; } code = translateKey(event->name); eDebug("LIRC name=%s code=%d flags=%d", event->name, code, flags); input->keyPressed(eRCKey(this, code, flags)); if (flags == eRCKey::flagMake) { flags = eRCKey::flagBreak; eDebug("LIRC name=%s code=%d flags=%d", event->name, code, flags); input->keyPressed(eRCKey(this, code, flags)); flags = eRCKey::flagMake; } }
void eRCDeviceDreambox2::repeat() { if (ccode != -1) { input->keyPressed(eRCKey(this, getKeyCode(ccode&0x7FFF), eRCKey::flagRepeat)); } repeattimer.start(getRepeatRate(), 1); }
void eRCDeviceDreambox2::timeOut() { int oldcc = ccode; ccode = -1; repeattimer.stop(); if (oldcc != -1) { input->keyPressed(eRCKey(this, getKeyCode(oldcc&0x7FFF), eRCKey::flagBreak)); } }
void eSDLInputDevice::handleCode(long arg) { const SDL_KeyboardEvent *event = (const SDL_KeyboardEvent *)arg; const SDL_keysym *key = &event->keysym; int km = input->getKeyboardMode(); int code, flags; if (event->type == SDL_KEYDOWN) { m_unicode = key->unicode; flags = eRCKey::flagMake; } else { flags = eRCKey::flagBreak; } if (km == eRCInput::kmNone) { code = translateKey(key->sym); } else { eDebug("unicode=%04x scancode=%02x", m_unicode, key->scancode); if (m_unicode & 0xff80) { eDebug("SDL: skipping unicode character"); return; } code = m_unicode & ~0xff80; // unicode not set...!? use key symbol if (code == 0) { // keysym is ascii if (key->sym >= 128) { eDebug("SDL: cannot emulate ASCII"); return; } eDebug("SDL: emulate ASCII"); code = key->sym; } if (km == eRCInput::kmAscii) { // skip ESC c or ESC '[' c if (m_escape) { if (code != '[') m_escape = false; return; } if (code == SDLK_ESCAPE) m_escape = true; if ((code < SDLK_SPACE) || (code == 0x7e) || // really? (code == SDLK_DELETE)) return; } flags |= eRCKey::flagAscii; } eDebug("SDL code=%d flags=%d", code, flags); input->keyPressed(eRCKey(this, code, flags)); }
void eRCDeviceDreamboxButton::repeat() { for (int i = 0; i < 4; i++) { if (last & (1<<i)) { /*emit*/ input->keyPressed(eRCKey(this, getKeyCode(i), eRCKey::flagRepeat)); } } repeattimer.start(getRepeatRate(), 1); }
void eRCDeviceInputDev::handleCode(long rccode) { struct input_event *ev = (struct input_event *)rccode; if (ev->type != EV_KEY) return; eDebug("%x %x %x", ev->value, ev->code, ev->type); int km = iskeyboard ? input->getKeyboardMode() : eRCInput::kmNone; switch (ev->code) { case KEY_LEFTSHIFT: case KEY_RIGHTSHIFT: shiftState = ev->value; break; case KEY_CAPSLOCK: if (ev->value == 1) capsState = !capsState; break; } if (km == eRCInput::kmAll) return; if (km == eRCInput::kmAscii) { bool ignore = false; bool ascii = (ev->code > 0 && ev->code < 61); switch (ev->code) { case KEY_LEFTCTRL: case KEY_RIGHTCTRL: case KEY_LEFTSHIFT: case KEY_RIGHTSHIFT: case KEY_LEFTALT: case KEY_RIGHTALT: case KEY_CAPSLOCK: ignore = true; break; case KEY_RESERVED: case KEY_ESC: case KEY_TAB: case KEY_BACKSPACE: case KEY_ENTER: case KEY_INSERT: case KEY_DELETE: case KEY_MUTE: ascii = false; default: break; } if (ignore) return; if (ascii) { if (ev->value) { if (consoleFd >= 0) { struct kbentry ke; /* off course caps is not the same as shift, but this will have to do for now */ ke.kb_table = (shiftState || capsState) ? K_SHIFTTAB : K_NORMTAB; ke.kb_index = ev->code; ::ioctl(consoleFd, KDGKBENT, &ke); if (ke.kb_value) input->keyPressed(eRCKey(this, ke.kb_value & 0xff, eRCKey::flagAscii)); /* emit */ } } return; } } #if KEY_TEXT_TO_KEY_AUDIO if (ev->code == KEY_AUDIO) { /* AZBOX rc has a KEY aux key, which sends KEY_TEXT events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_TEXT; } else if (ev->code == KEY_AUDIO) { /* AZBOX rc has a KEY Check key, which sends KEY_AUDIO events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_TEXT; } #endif #if KEY_PLAY_ACTUALLY_IS_KEY_PLAYPAUSE if (ev->code == KEY_PLAY) { if (id == "dreambox advanced remote control (native)") { /* 8k rc has a KEY_PLAYPAUSE key, which sends KEY_PLAY events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_PLAYPAUSE; } } #endif switch (ev->value) { case 0: input->keyPressed(eRCKey(this, ev->code, eRCKey::flagBreak)); /*emit*/ break; case 1: input->keyPressed(eRCKey(this, ev->code, 0)); /*emit*/ break; case 2: input->keyPressed(eRCKey(this, ev->code, eRCKey::flagRepeat)); /*emit*/ break; } }
void eRCDeviceInputDev::handleCode(long rccode) { struct input_event *ev = (struct input_event *)rccode; if (ev->type!=EV_KEY) return; #ifdef VUPLUS_USE_RCKBD //eDebug("value : %d, code : %d, type : %d, type : %s", ev->value, ev->code, ev->type, getType(ev->code)?"ASCII":"RC"); if(getType(ev->code) || special_key_mode) { switch(ev->value) { case 0: if(ev->code == KEY_RALT || ev->code == KEY_LSHIFT || ev->code == KEY_LALT) { special_key_mode = 0; g_ConsoleDevice->handleCode(0); } break; case 1: if(ev->code == KEY_RALT || ev->code == KEY_LSHIFT || ev->code == KEY_LALT) special_key_mode = 1; g_ConsoleDevice->handleCode(ev->code); break; case 2: break; } return; } #endif /*VUPLUS_USE_RCKBD*/ // eDebug("%x %x %x", ev->value, ev->code, ev->type); int km = iskeyboard ? input->getKeyboardMode() : eRCInput::kmNone; // eDebug("keyboard mode %d", km); if (km == eRCInput::kmAll) return; if (km == eRCInput::kmAscii) { // eDebug("filtering.. %d", ev->code); bool filtered = ( ev->code > 0 && ev->code < 61 ); switch (ev->code) { case KEY_RESERVED: case KEY_ESC: case KEY_TAB: case KEY_BACKSPACE: case KEY_ENTER: case KEY_LEFTCTRL: case KEY_RIGHTSHIFT: case KEY_LEFTALT: case KEY_CAPSLOCK: case KEY_INSERT: case KEY_DELETE: case KEY_MUTE: filtered=false; default: break; } if (filtered) return; // eDebug("passed!"); } switch (ev->value) { case 0: /*emit*/ input->keyPressed(eRCKey(this, ev->code, eRCKey::flagBreak)); break; case 1: /*emit*/ input->keyPressed(eRCKey(this, ev->code, 0)); break; case 2: /*emit*/ input->keyPressed(eRCKey(this, ev->code, eRCKey::flagRepeat)); break; } }
void eRCConsole::handleCode(long code) { input->keyPressed(eRCKey(this, code, eRCKey::flagAscii)); }
void eRCDeviceInputDev::handleCode(long rccode) { struct input_event *ev = (struct input_event *)rccode; if (ev->type != EV_KEY) return; eDebug("%x %x %x", ev->value, ev->code, ev->type); int km = iskeyboard ? input->getKeyboardMode() : eRCInput::kmNone; switch (ev->code) { case KEY_LEFTSHIFT: case KEY_RIGHTSHIFT: shiftState = ev->value; break; case KEY_CAPSLOCK: if (ev->value == 1) capsState = !capsState; break; } if (km == eRCInput::kmAll) return; if (km == eRCInput::kmAscii) { bool ignore = false; bool ascii = (ev->code > 0 && ev->code < 61); switch (ev->code) { case KEY_LEFTCTRL: case KEY_RIGHTCTRL: case KEY_LEFTSHIFT: case KEY_RIGHTSHIFT: case KEY_LEFTALT: case KEY_RIGHTALT: case KEY_CAPSLOCK: ignore = true; break; case KEY_RESERVED: case KEY_ESC: case KEY_TAB: case KEY_BACKSPACE: case KEY_ENTER: case KEY_INSERT: case KEY_DELETE: case KEY_MUTE: ascii = false; default: break; } if (ignore) return; if (ascii) { if (ev->value) { if (consoleFd >= 0) { struct kbentry ke; /* off course caps is not the same as shift, but this will have to do for now */ ke.kb_table = (shiftState || capsState) ? K_SHIFTTAB : K_NORMTAB; ke.kb_index = ev->code; ::ioctl(consoleFd, KDGKBENT, &ke); if (ke.kb_value) input->keyPressed(eRCKey(this, ke.kb_value & 0xff, eRCKey::flagAscii)); /* emit */ } } return; } } #if KEY_VIDEO_TO_KEY_EPG if (ev->code == KEY_VIDEO) { /* AZBOX rc has a KEY_EPG key, which sends KEY_VIDEO events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_EPG; } #endif #if KEY_VIDEO_TO_KEY_SUBTITLE if (ev->code == KEY_VIDEO) { /* AZBOX rc has a KEY_SUBTITLE key, which sends KEY_VIDEO events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_SUBTITLE; } #endif #if KEY_TV_TO_KEY_STOP if (ev->code == KEY_TV) { /* AZBOX rc has a KEY_STOP key, which sends KEY_TV events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_STOP; } #endif #if KEY_RADIO_TO_KEY_RECORD if (ev->code == KEY_RADIO) { /* AZBOX rc has a KEY_RECORD key, which sends KEY_RADIO events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_RECORD; } #endif #if KEY_HOME_TO_KEY_OPEN if (ev->code == KEY_HOME) { /* AZBOX rc has no radio/tv/pvr key, we use KEY_HOME which sends KEY_OPEN events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_OPEN; } #endif #if KEY_TV_TO_KEY_VIDEO if (ev->code == KEY_TV) { /* Venton HD1 rc has a no KEY_VIDEO key, which sends KEY_TV events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_VIDEO; } #endif #if KEY_BOOKMARKS_TO_KEY_DIRECTORY if (ev->code == KEY_BOOKMARKS) { /* Venton ini2 remote has a KEY_BOOKMARKS key we need KEY_DIRECTORY. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_DIRECTORY; } #endif #if KEY_MEDIA_TO_KEY_BOOKMARKS if (ev->code == KEY_MEDIA) { /* Venton ini2 remote has a KEY_MEDIA key we need KEY_Bookmark. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_BOOKMARKS; } #endif #if KEY_SEARCH_TO_KEY_WWW if (ev->code == KEY_SEARCH) { /* Venton rc has a a Key WWW and send KEY_SEARCH. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_WWW; } #endif #if KEY_POWER2_TO_KEY_WWW if (ev->code == KEY_POWER2) { /* Venton rc has a a Key WWW and send KEY_POWER2. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_WWW; } #endif #if KEY_DIRECTORY_TO_KEY_FILE if (ev->code == KEY_DIRECTORY) { /* Venton rc has a a KEY_DIRECTORY and send KEY_FILE. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_FILE; } #endif #if KEY_OPTION_TO_KEY_PC if (ev->code == KEY_OPTION) { /* Venton rc has a a Key LAN and send KEY_OPTION. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_PC; } #endif #if KEY_VIDEO_TO_KEY_MODE if (ev->code == KEY_VIDEO) { /* Venton rc has a a Key Format and send KEY_Video. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_MODE; } #endif #if KEY_GUIDE_TO_KEY_EPG if (ev->code == KEY_HELP) { /* GB800 rc has a KEY_GUIDE key, which sends KEY_HELP events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_EPG; } #endif #if KEY_PLAY_ACTUALLY_IS_KEY_PLAYPAUSE if (ev->code == KEY_PLAY) { if ((id == "dreambox advanced remote control (native)") || (id == "bcm7325 remote control")) { /* 8k rc has a KEY_PLAYPAUSE key, which sends KEY_PLAY events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_PLAYPAUSE; } } #endif #if KEY_F1_TO_KEY_PC if (ev->code == KEY_F1) { /* Technomate , which sends KEY_F1 events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_PC; } #endif #if KEY_F5_TO_KEY_ANGLE if (ev->code == KEY_F5) { /* Technomate , which sends KEY_F5 events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_ANGLE; } #endif #if KEY_DOT_TO_KEY_HOMEPAGE if (ev->code == KEY_DOT) { /* Technomate , which sends KEY_DOT events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_HOMEPAGE; } #endif #if KEY_SCREEN_TO_KEY_ANGLE if (ev->code == KEY_SCREEN) { /* MixOs , which sends KEY_SCREEN events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_ANGLE; } #endif #if KEY_ZOOM_TO_KEY_SCREEN if (ev->code == KEY_ZOOM) { /* Venton rc has a a Key LAN and send KEY_OPTION. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_SCREEN; } #endif #if KEY_TIME_TO_KEY_SLEEP if (ev->code == KEY_SLEEP) { /* MixOs , which sends KEY_SLEEP events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_PROGRAM; } #endif #if KEY_LIST_TO_KEY_PVR if (ev->code == KEY_LIST) { /* HDx , which sends KEY_LIST events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_PVR; } #endif #if KEY_INFO_TO_KEY_EPG /* INFO to EPG Toggle , which sends KEY_INFO events. Correct this, so we do not have to place hacks in the keymaps. */ if (ev->code == KEY_INFO) { if (ev->value == 0) { ev->code = KEY_EPG; } else { ev->code = KEY_INFO; ev->value == 0; } } #endif #if KEY_EPG_TO_KEY_INFO /* EPG to INFO Toggle , which sends KEY_EPG events. Correct this, so we do not have to place hacks in the keymaps. */ if (ev->code == KEY_EPG) { if (ev->value == 0) { ev->code = KEY_EPG; } else { ev->code = KEY_INFO; ev->value == 0; } } #endif switch (ev->value) { case 0: input->keyPressed(eRCKey(this, ev->code, eRCKey::flagBreak)); /*emit*/ break; case 1: input->keyPressed(eRCKey(this, ev->code, 0)); /*emit*/ break; case 2: input->keyPressed(eRCKey(this, ev->code, eRCKey::flagRepeat)); /*emit*/ break; } }
void eRCDeviceInputDev::handleCode(long rccode) { struct input_event *ev = (struct input_event *)rccode; #if WETEKRC /* eDebug("==> BEFORE check for evtype: %x %x %x", ev->value, ev->code, ev->type); eDebug("==> BEFORE check for evtype:-->BackspaceFLAG %d", bflag); */ if (ev->code == KEY_BACKSPACE && ev->value == 1 ) { bflag = !bflag; } /* eDebug("==> BEFORE check for evtype after check for evvalue:-->BackspaceFLAG %d", bflag); */ #endif if (ev->type != EV_KEY) return; eDebug("%x %x %x", ev->value, ev->code, ev->type); int km = iskeyboard ? input->getKeyboardMode() : eRCInput::kmNone; switch (ev->code) { case KEY_LEFTSHIFT: case KEY_RIGHTSHIFT: shiftState = ev->value; break; case KEY_CAPSLOCK: if (ev->value == 1) capsState = !capsState; break; } if (km == eRCInput::kmAll) return; if (km == eRCInput::kmAscii) { bool ignore = false; bool ascii = (ev->code > 0 && ev->code < 61); switch (ev->code) { case KEY_LEFTCTRL: case KEY_RIGHTCTRL: case KEY_LEFTSHIFT: case KEY_RIGHTSHIFT: case KEY_LEFTALT: case KEY_RIGHTALT: case KEY_CAPSLOCK: ignore = true; break; case KEY_RESERVED: case KEY_ESC: case KEY_TAB: case KEY_BACKSPACE: /* bflag = !bflag; eDebug("--> AFTER flip BackspaceFLAG %d", bflag); */ case KEY_ENTER: case KEY_INSERT: case KEY_DELETE: case KEY_MUTE: ascii = false; default: break; } if (ignore) return; if (ascii) { if (ev->value) { if (consoleFd >= 0) { struct kbentry ke; /* off course caps is not the same as shift, but this will have to do for now */ ke.kb_table = (shiftState || capsState) ? K_SHIFTTAB : K_NORMTAB; ke.kb_index = ev->code; ::ioctl(consoleFd, KDGKBENT, &ke); if (ke.kb_value) input->keyPressed(eRCKey(this, ke.kb_value & 0xff, eRCKey::flagAscii)); /* emit */ } } return; } } #if WETEKRC /* eDebug("-->BackspaceFLAG %d", bflag); eDebug("-->before change %x %x %x", ev->value, ev->code, ev->type); */ /* default is with NO numerc keys !!!*/ if (bflag) { if (ev->code == KEY_1) { ev->code = KEY_RED; } if (ev->code == KEY_2) { ev->code = KEY_GREEN; } if (ev->code == KEY_3) { ev->code = KEY_YELLOW; } if (ev->code == KEY_4) { ev->code = KEY_BLUE; } if (ev->code == KEY_5) { ev->code = KEY_PREVIOUS; } if (ev->code == KEY_6) { ev->code = KEY_NEXT; } if (ev->code == KEY_7) { ev->code = KEY_REWIND; } if (ev->code == KEY_8) { ev->code = KEY_STOP; } if (ev->code == KEY_9) { ev->code = KEY_FASTFORWARD; } if (ev->code == KEY_0) { ev->code = KEY_PLAYPAUSE; } } /* eDebug("-->BackspaceFLAG %d", bflag); eDebug("-->after change %x %x %x", ev->value, ev->code, ev->type); */ #endif #if KEY_F7_TO_KEY_MENU if (ev->code == KEY_F7) { ev->code = KEY_MENU; } #endif #if KEY_F1_TO_KEY_MEDIA if (ev->code == KEY_F1) { ev->code = KEY_MEDIA; } #endif #if KEY_HOME_TO_KEY_INFO if (ev->code == KEY_HOME) { ev->code = KEY_INFO; } #endif #if KEY_BACK_TO_KEY_EXIT if (ev->code == KEY_BACK) { ev->code = KEY_EXIT; } #endif #if KEY_F2_TO_KEY_EPG if (ev->code == KEY_F2) { ev->code = KEY_EPG; } #endif #if KEY_ENTER_TO_KEY_OK if (ev->code == KEY_ENTER) { ev->code = KEY_OK; } #endif #if KEY_LAST_TO_KEY_PVR if (ev->code == KEY_LAST) { /* xwidowx Remote rc has a Funktion key, which sends KEY_LAST events but we need a KEY_PVR. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_PVR; } #endif #if KEY_LAST_TO_KEY_BACK if (ev->code == KEY_LAST) { /* sf108 Remote rc has a Funktion key, which sends KEY_LAST events but we need a KEY_BACK. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_BACK; } #endif #if KEY_MEDIA_TO_KEY_LIST if (ev->code == KEY_MEDIA) { /* entwodia Remote rc has a Funktion key, which sends KEY_MEDIA events but we need a KEY_LIST. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_LIST; } #endif #if KEY_F1_TO_KEY_F2 if (ev->code == KEY_F1) { /* ET7X00 Remote rc has a Funktion key, which sends KEY_F1 events but we need a KEY_F2. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_F2; } #endif #if KEY_INFO_TO_KEY_EPG if (ev->code == KEY_INFO) { /* vu Remote rc has a EPG key, which sends KEY_INFO events but we need a KEY_EPG. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_EPG; } #endif #if KEY_HELP_TO_KEY_INFO if (ev->code == KEY_HELP) { /* vu Remote rc has a HELP key, which sends KEY_HELP events but we need a KEY_INFO. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_INFO; } #endif #if KEY_MODE_TO_KEY_AUDIO if (ev->code == KEY_MODE) { /* ebox Remote rc has a AV key, which sends KEY_MODE events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_AUDIO; } #endif #if KEY_VIDEO_IS_KEY_SCREEN if (ev->code == KEY_VIDEO) { /* Blackbox Remote rc has a KEY_PIP key, which sends KEY_VIDEO events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_SCREEN; } #endif #if KEY_ARCHIVE_TO_KEY_DIRECTORY if (ev->code == KEY_ARCHIVE) { /* Blackbox Remote rc has a KEY_PLUGIN key, which sends KEY_ARCHIVE events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_DIRECTORY; } #endif #if KEY_TIME_TO_KEY_SLOW if (ev->code == KEY_TIME) { /* Blackbox Remote rc has a KEY_PLUGIN key, which sends KEY_TIME events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_SLOW; } #endif #if KEY_TEXT_TO_KEY_AUDIO if (ev->code == KEY_AUDIO) { /* AZBOX rc has a KEY aux key, which sends KEY_TEXT events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_TEXT; } else if (ev->code == KEY_AUDIO) { /* AZBOX rc has a KEY Check key, which sends KEY_AUDIO events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_TEXT; } #endif #if KEY_F2_TO_KEY_F6 if (ev->code == KEY_F2) { /* Gigablue New Remote rc has a KEY_PIP key, which sends KEY_F2 events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_F6; } #endif #if KEY_F3_TO_KEY_LIST if (ev->code == KEY_F3) { /* Xtrend New Remote rc has a KEY_F3 key, which sends KEY_LIST events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_LIST; } #endif #if KEY_TV_TO_KEY_MODE if (ev->code == KEY_TV) { /* AZBOX rc has a KEY_MODE key, which sends KEY_TV events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_MODE; } #endif #if KEY_VIDEO_TO_KEY_EPG if (ev->code == KEY_VIDEO) { /* AZBOX rc has a KEY_EPG key, which sends KEY_VIDEO events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_EPG; } #endif #if KEY_VIDEO_TO_KEY_SUBTITLE if (ev->code == KEY_VIDEO) { /* AZBOX rc has a KEY_SUBTITLE key, which sends KEY_VIDEO events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_SUBTITLE; } #endif #if KEY_TV_TO_KEY_STOP if (ev->code == KEY_TV) { /* AZBOX rc has a KEY_STOP key, which sends KEY_TV events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_STOP; } #endif #if KEY_RADIO_TO_KEY_RECORD if (ev->code == KEY_RADIO) { /* AZBOX rc has a KEY_RECORD key, which sends KEY_RADIO events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_RECORD; } #endif #if KEY_HOME_TO_KEY_OPEN if (ev->code == KEY_HOME) { /* AZBOX rc has no radio/tv/pvr key, we use KEY_HOME which sends KEY_OPEN events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_OPEN; } #endif #if KEY_HOME_TO_KEY_HOMEPAGE if (ev->code == KEY_HOME) { /* DAGS map HOME Key to show Mediaportal */ ev->code = KEY_HOMEPAGE; } #endif #if KEY_MEDIA_TO_KEY_KEY_F2 if (ev->code == KEY_MEDIA) { /* DAGS map Media to F2 to show MediaCenter */ ev->code = KEY_F2; } #endif #if KEY_TV_TO_KEY_VIDEO if (ev->code == KEY_TV) { /* Venton HD1 rc has a no KEY_VIDEO key, which sends KEY_TV events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_VIDEO; } #endif #if KEY_BOOKMARKS_TO_KEY_DIRECTORY if (ev->code == KEY_BOOKMARKS) { /* Venton ini2 remote has a KEY_BOOKMARKS key we need KEY_DIRECTORY. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_DIRECTORY; } #endif #if KEY_MEDIA_TO_KEY_BOOKMARKS if (ev->code == KEY_MEDIA) { /* Venton ini2 remote has a KEY_MEDIA key we need KEY_Bookmark. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_BOOKMARKS; } #endif #if KEY_MEDIA_TO_KEY_OPEN if (ev->code == KEY_MEDIA) { /* Venton ini2 remote has a KEY_MEDIA key we need KEY_OPEN. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_OPEN; } #endif #if KEY_SEARCH_TO_KEY_WWW if (ev->code == KEY_SEARCH) { /* Venton rc has a a Key WWW and send KEY_SEARCH. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_WWW; } #endif #if KEY_POWER2_TO_KEY_WWW if (ev->code == KEY_POWER2) { /* Venton rc has a a Key WWW and send KEY_POWER2. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_WWW; } #endif #if KEY_DIRECTORY_TO_KEY_FILE if (ev->code == KEY_DIRECTORY) { /* Venton rc has a a KEY_DIRECTORY and send KEY_FILE. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_FILE; } #endif #if KEY_OPTION_TO_KEY_PC if (ev->code == KEY_OPTION) { /* Venton rc has a a Key LAN and send KEY_OPTION. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_PC; } #endif #if KEY_VIDEO_TO_KEY_MODE if (ev->code == KEY_VIDEO) { /* Venton rc has a a Key Format and send KEY_Video. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_MODE; } #endif #if KEY_GUIDE_TO_KEY_EPG if (ev->code == KEY_HELP) { /* GB800 rc has a KEY_GUIDE key, which sends KEY_HELP events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_EPG; } #endif #if KEY_SCREEN_TO_KEY_MODE if (ev->code == KEY_SCREEN) { /* GB800 rc has a KEY_ASPECT key, which sends KEY_SCREEN events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_MODE; } #endif #if KEY_PLAY_IS_KEY_PLAYPAUSE if (ev->code == KEY_PLAY) { /* sogno rc has a KEY_PLAYPAUSE key, which sends KEY_PLAY events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_PLAYPAUSE; } #endif #if KEY_PLAY_ACTUALLY_IS_KEY_PLAYPAUSE if (ev->code == KEY_PLAY) { if ((id == "dreambox advanced remote control (native)") || (id == "bcm7325 remote control")) { /* 8k rc has a KEY_PLAYPAUSE key, which sends KEY_PLAY events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_PLAYPAUSE; } } #endif #if KEY_F1_TO_KEY_PC if (ev->code == KEY_F1) { /* Technomate , which sends KEY_F1 events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_PC; } #endif #if KEY_F5_TO_KEY_ANGLE if (ev->code == KEY_F5) { /* Technomate , which sends KEY_F5 events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_ANGLE; } #endif #if KEY_DOT_TO_KEY_HOMEPAGE if (ev->code == KEY_DOT) { /* Technomate , which sends KEY_DOT events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_HOMEPAGE; } #endif #if KEY_SCREEN_TO_KEY_ANGLE if (ev->code == KEY_SCREEN) { /* MixOs , which sends KEY_SCREEN events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_ANGLE; } #endif #if KEY_ZOOM_TO_KEY_SCREEN if (ev->code == KEY_ZOOM) { /* Venton rc has a a Key LAN and send KEY_OPTION. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_SCREEN; } #endif #if KEY_TIME_TO_KEY_SLEEP if (ev->code == KEY_SLEEP) { /* MixOs , which sends KEY_SLEEP events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_PROGRAM; } #endif #if KEY_LIST_TO_KEY_PVR if (ev->code == KEY_LIST) { /* HDx , which sends KEY_LIST events. Correct this, so we do not have to place hacks in the keymaps. */ ev->code = KEY_PVR; } #endif switch (ev->value) { case 0: input->keyPressed(eRCKey(this, ev->code, eRCKey::flagBreak)); /*emit*/ break; case 1: input->keyPressed(eRCKey(this, ev->code, 0)); /*emit*/ break; case 2: input->keyPressed(eRCKey(this, ev->code, eRCKey::flagRepeat)); /*emit*/ break; } }
void eRCConsole::handleCode(int code) { // eDebug("console code is %d", code); input->keyPressed(eRCKey(this, code, 0)); }