|
@@ -4,6 +4,10 @@
|
|
|
#include <IRremote.h>
|
|
|
#include <HID-Project.h> // HID-Project 2.8.2
|
|
|
|
|
|
+// switch on/off debug mode at once
|
|
|
+bool isDebugBuild = false;
|
|
|
+
|
|
|
+// enable HID Keyboard output
|
|
|
bool sendHID = true;
|
|
|
|
|
|
// ATTENTION - set ALL debug and useSerial to false in normal usage
|
|
@@ -13,8 +17,9 @@ bool debug2 = false;
|
|
|
bool useSerial = false;
|
|
|
|
|
|
// global conf vars
|
|
|
-unsigned int holdButton_releaseTimeout = 120;
|
|
|
+unsigned int holdButton_releaseTimeout = 120; // global default, will be overwritten depending on RC code used
|
|
|
|
|
|
+#define BTN_UNKNOWN 0
|
|
|
|
|
|
#define BTN_1 1
|
|
|
#define BTN_2 2
|
|
@@ -26,6 +31,7 @@ unsigned int holdButton_releaseTimeout = 120;
|
|
|
#define BTN_8 8
|
|
|
#define BTN_9 9
|
|
|
#define BTN_0 10
|
|
|
+
|
|
|
#define BTN_PLAY 11
|
|
|
#define BTN_PAUSE 12
|
|
|
#define BTN_STOP 13
|
|
@@ -35,29 +41,37 @@ unsigned int holdButton_releaseTimeout = 120;
|
|
|
#define BTN_PREV 17
|
|
|
#define BTN_NEXT 18
|
|
|
#define BTN_LEFT 20
|
|
|
+
|
|
|
#define BTN_RIGHT 21
|
|
|
#define BTN_UP 22
|
|
|
#define BTN_DOWN 23
|
|
|
#define BTN_OK_ENTER 24
|
|
|
+
|
|
|
#define BTN_BACK 25
|
|
|
#define BTN_MENU 26
|
|
|
#define BTN_HOME 27
|
|
|
+
|
|
|
#define BTN_RED 30
|
|
|
#define BTN_GREEN 31
|
|
|
#define BTN_YELLOW 32
|
|
|
#define BTN_BLUE 33
|
|
|
+
|
|
|
#define BTN_STATUS 34
|
|
|
#define BTN_RETURN 35
|
|
|
+
|
|
|
#define BTN_SETUP 36
|
|
|
#define BTN_GUIDE 37
|
|
|
#define BTN_RADIO 38
|
|
|
#define BTN_PREVCH 39
|
|
|
+
|
|
|
#define BTN_CH_DOWN 40
|
|
|
#define BTN_CH_UP 41
|
|
|
+
|
|
|
#define BTN_VOL_DOWN 42
|
|
|
#define BTN_VOL_UP 43
|
|
|
+
|
|
|
#define BTN_MUTE 44
|
|
|
-#define BTN_POWER 45
|
|
|
+
|
|
|
#define BTN_TV 46
|
|
|
#define BTN_VIDEOS 47
|
|
|
#define BTN_MUSIC 48
|
|
@@ -69,13 +83,19 @@ unsigned int holdButton_releaseTimeout = 120;
|
|
|
#define BTN_CONTEXT 62
|
|
|
#define BTN_INFO 63
|
|
|
|
|
|
-#define BTN_DUMMY 255
|
|
|
+#define BTN_POWER 100
|
|
|
+#define BTN_TASKSWITCH 101
|
|
|
+#define BTN_SLEEP 102
|
|
|
+
|
|
|
+#define BTN_REPETITION 255
|
|
|
|
|
|
|
|
|
// Button Modes
|
|
|
-#define BUTTONMODE_ONCE 0
|
|
|
-#define BUTTONMODE_REPEAT 1
|
|
|
+#define BUTTONMODE_LAST 0
|
|
|
+#define BUTTONMODE_ONCE 1
|
|
|
#define BUTTONMODE_HOLD 2
|
|
|
+#define BUTTONMODE_REPEAT 3
|
|
|
+#define BUTTONMODE_EXTENDED_REPEAT 4
|
|
|
|
|
|
// Remote Types
|
|
|
#define REMOTETYPE_RC5 0
|
|
@@ -98,7 +118,12 @@ IRrecv irrecv(recvPin);
|
|
|
//
|
|
|
void setup ( )
|
|
|
{
|
|
|
- if(useSerial || debug || debug2) Serial.begin(115200);
|
|
|
+ if (isDebugBuild) {
|
|
|
+ useSerial = true;
|
|
|
+ debug = true;
|
|
|
+ debug2 = true;
|
|
|
+ }
|
|
|
+ if (useSerial || debug || debug2) Serial.begin(115200);
|
|
|
BootKeyboard.begin();
|
|
|
Consumer.begin();
|
|
|
System.begin();
|
|
@@ -151,17 +176,36 @@ void dumpInfo (decode_results *results)
|
|
|
|
|
|
|
|
|
// Hauppauge Remote
|
|
|
- if (_currRC5Code == 0xBD) { // POWER
|
|
|
+ if (_currRC5Code == 0xBD) { // POWER (upper right key)
|
|
|
//handleButton_RCx(BTN_POWER, BUTTONMODE_REPEAT, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
- handlePowerButton();
|
|
|
+ //handlePowerButton();
|
|
|
+ handleButton_RCx(BTN_POWER, BUTTONMODE_REPEAT, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
}
|
|
|
- else if (_currRC5Code == 0x90) { // VOL+
|
|
|
- //handleButton_RCx(BTN_VOL_UP, BUTTONMODE_REPEAT, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
- handleButton_RCx(BTN_VOL_UP, BUTTONMODE_HOLD, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+
|
|
|
+ else if (_currRC5Code == 0xBB) { // HOME/GO (upper left key)
|
|
|
+ //handleButton_RCx(BTN_HOME, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+ //handleTaskSwitchButton();
|
|
|
+ handleButton_RCx(BTN_TASKSWITCH, BUTTONMODE_REPEAT, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
}
|
|
|
- else if (_currRC5Code == 0x91) { // VOL-
|
|
|
- //handleButton_RCx(BTN_VOL_DOWN, BUTTONMODE_REPEAT, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
- handleButton_RCx(BTN_VOL_DOWN, BUTTONMODE_HOLD, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+
|
|
|
+ // media player controls
|
|
|
+ else if (_currRC5Code == 0xB7) { // REC
|
|
|
+ handleButton_RCx(BTN_REC, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+ }
|
|
|
+ else if (_currRC5Code == 0xB6) { // STOP
|
|
|
+ handleButton_RCx(BTN_STOP, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+ }
|
|
|
+ else if (_currRC5Code == 0xB5) { // PLAY
|
|
|
+ handleButton_RCx(BTN_PLAY, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+ }
|
|
|
+ else if (_currRC5Code == 0xB0) { // PAUSE
|
|
|
+ handleButton_RCx(BTN_PAUSE, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+ }
|
|
|
+ else if (_currRC5Code == 0xA4) { // PREV
|
|
|
+ handleButton_RCx(BTN_PREV, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+ }
|
|
|
+ else if (_currRC5Code == 0x9E) { // NEXT
|
|
|
+ handleButton_RCx(BTN_NEXT, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
}
|
|
|
else if (_currRC5Code == 0xB2) { // REWIND
|
|
|
//handleButton_RCx(BTN_REWD, BUTTONMODE_REPEAT, _currRC5Pref, REMOTETYPE_RC5);
|
|
@@ -173,49 +217,78 @@ void dumpInfo (decode_results *results)
|
|
|
//handleButton_RCx(BTN_FFWD, BUTTONMODE_HOLD, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
handleButton_RCx(BTN_FFWD, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
}
|
|
|
- else if (_currRC5Code == 0xA1) { // CH- used as page down
|
|
|
- handleButton_RCx(BTN_CH_DOWN, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+
|
|
|
+ // above control pad
|
|
|
+ else if (_currRC5Code == 0x9B) { // GUIDE -> left above control pad
|
|
|
+ //handleButton_RCx(BTN_GUIDE, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+ handleButton_RCx(BTN_TASKSWITCH, BUTTONMODE_REPEAT, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
}
|
|
|
- else if (_currRC5Code == 0xA0) { // CH+ used as page up
|
|
|
- handleButton_RCx(BTN_CH_UP, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+ else if (_currRC5Code == 0x8C) { // RADIO -> right above control pad
|
|
|
+ //handleButton_RCx(BTN_RADIO, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+ handleButton_RCx(BTN_CONTEXT, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+ }
|
|
|
+
|
|
|
+ // control pad
|
|
|
+ else if (_currRC5Code == 0xA5) { // OK
|
|
|
+ //handleButton_RCx(BTN_OK_ENTER, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+ handleButton_RCx(BTN_OK_ENTER, BUTTONMODE_HOLD, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
}
|
|
|
else if (_currRC5Code == 0x94) { // ARROW UP
|
|
|
//handleButton_RCx(BTN_UP, BUTTONMODE_REPEAT, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
- handleButton_RCx(BTN_UP, BUTTONMODE_HOLD, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+ //handleButton_RCx(BTN_UP, BUTTONMODE_HOLD, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+ handleButton_RCx(BTN_UP, BUTTONMODE_EXTENDED_REPEAT, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
}
|
|
|
else if (_currRC5Code == 0x95) { // ARROW DOWN
|
|
|
//handleButton_RCx(BTN_DOWN, BUTTONMODE_REPEAT, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
- handleButton_RCx(BTN_DOWN, BUTTONMODE_HOLD, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+ //handleButton_RCx(BTN_DOWN, BUTTONMODE_HOLD, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+ handleButton_RCx(BTN_DOWN, BUTTONMODE_EXTENDED_REPEAT, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
}
|
|
|
else if (_currRC5Code == 0x96) { // ARROW LEFT
|
|
|
//handleButton_RCx(BTN_LEFT, BUTTONMODE_REPEAT, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
- handleButton_RCx(BTN_LEFT, BUTTONMODE_HOLD, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+ //handleButton_RCx(BTN_LEFT, BUTTONMODE_HOLD, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+ handleButton_RCx(BTN_LEFT, BUTTONMODE_EXTENDED_REPEAT, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
}
|
|
|
else if (_currRC5Code == 0x97) { // ARROW RIGHT
|
|
|
//handleButton_RCx(BTN_RIGHT, BUTTONMODE_REPEAT, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
- handleButton_RCx(BTN_RIGHT, BUTTONMODE_HOLD, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+ //handleButton_RCx(BTN_RIGHT, BUTTONMODE_HOLD, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+ handleButton_RCx(BTN_RIGHT, BUTTONMODE_EXTENDED_REPEAT, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
}
|
|
|
else if (_currRC5Code == 0xA5) { // OK
|
|
|
//handleButton_RCx(BTN_OK_ENTER, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
- handleButton_RCx(BTN_OK_ENTER, BUTTONMODE_HOLD, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+ handleButton_RCx(BTN_OK_ENTER, BUTTONMODE_EXTENDED_REPEAT, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+ }
|
|
|
+
|
|
|
+ // below control pad
|
|
|
+ else if (_currRC5Code == 0x9F) { // BACK/EXIT -> -> swapped and used as on the other remotes as MENU
|
|
|
+ handleButton_RCx(BTN_MENU, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
}
|
|
|
- else if (_currRC5Code == 0x9F) { // BACK/EXIT
|
|
|
- //handleButton_RCx(BTN_BACK, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+ else if (_currRC5Code == 0x8D) { // i/MENU -> swapped and used as on the other remotes as BACK/EXIT
|
|
|
handleButton_RCx(BTN_BACK, BUTTONMODE_HOLD, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
}
|
|
|
- else if (_currRC5Code == 0x8D) { // i/MENU
|
|
|
- handleButton_RCx(BTN_MENU, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+
|
|
|
+ // volume controls
|
|
|
+ else if (_currRC5Code == 0x90) { // VOL+
|
|
|
+ handleButton_RCx(BTN_VOL_UP, BUTTONMODE_REPEAT, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
}
|
|
|
- else if (_currRC5Code == 0x92) { // PREV.CH
|
|
|
- handleButton_RCx(BTN_CONTEXT, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+ else if (_currRC5Code == 0x91) { // VOL-
|
|
|
+ handleButton_RCx(BTN_VOL_DOWN, BUTTONMODE_REPEAT, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
}
|
|
|
else if (_currRC5Code == 0x8F) { // MUTE
|
|
|
handleButton_RCx(BTN_MUTE, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
}
|
|
|
- else if (_currRC5Code == 0xBB) { // HOME/GO
|
|
|
- //handleButton_RCx(BTN_HOME, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
- handleTaskSwitchButton();
|
|
|
+
|
|
|
+ // channel controls
|
|
|
+ else if (_currRC5Code == 0xA1) { // CH- used as page down
|
|
|
+ handleButton_RCx(BTN_CH_DOWN, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+ }
|
|
|
+ else if (_currRC5Code == 0xA0) { // CH+ used as page up
|
|
|
+ handleButton_RCx(BTN_CH_UP, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
}
|
|
|
+ else if (_currRC5Code == 0x92) { // PREV.CH
|
|
|
+ handleButton_RCx(BTN_CONTEXT, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
+ }
|
|
|
+
|
|
|
+ // sources
|
|
|
else if (_currRC5Code == 0x9C) { // TV
|
|
|
handleButton_RCx(BTN_TV, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
}
|
|
@@ -228,30 +301,8 @@ void dumpInfo (decode_results *results)
|
|
|
else if (_currRC5Code == 0x9A) { // PICTURES
|
|
|
handleButton_RCx(BTN_PICTURES, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
}
|
|
|
- else if (_currRC5Code == 0x9B) { // GUIDE
|
|
|
- handleButton_RCx(BTN_GUIDE, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
- }
|
|
|
- else if (_currRC5Code == 0x8C) { // RADIO
|
|
|
- handleButton_RCx(BTN_RADIO, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
- }
|
|
|
- else if (_currRC5Code == 0xB7) { // REC
|
|
|
- handleButton_RCx(BTN_REC, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
- }
|
|
|
- else if (_currRC5Code == 0xB6) { // STOP
|
|
|
- handleButton_RCx(BTN_STOP, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
- }
|
|
|
- else if (_currRC5Code == 0xB5) { // PLAY
|
|
|
- handleButton_RCx(BTN_PLAY, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
- }
|
|
|
- else if (_currRC5Code == 0xB0) { // PAUSE
|
|
|
- handleButton_RCx(BTN_PAUSE, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
- }
|
|
|
- else if (_currRC5Code == 0xA4) { // PREV
|
|
|
- handleButton_RCx(BTN_PREV, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
- }
|
|
|
- else if (_currRC5Code == 0x9E) { // NEXT
|
|
|
- handleButton_RCx(BTN_NEXT, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
- }
|
|
|
+
|
|
|
+ // number keys
|
|
|
else if (_currRC5Code == 0x81) { // 1
|
|
|
handleButton_RCx(BTN_1, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
}
|
|
@@ -288,6 +339,8 @@ void dumpInfo (decode_results *results)
|
|
|
else if (_currRC5Code == 0x8E) { // #
|
|
|
handleButton_RCx(BTN_HASH, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
}
|
|
|
+
|
|
|
+ // color keys
|
|
|
else if (_currRC5Code == 0x8B) { // RED
|
|
|
handleButton_RCx(BTN_RED, BUTTONMODE_ONCE, _currRC5Pref, REMOTETYPE_RC5);
|
|
|
}
|
|
@@ -352,45 +405,61 @@ void dumpInfo (decode_results *results)
|
|
|
// with the most important buttons available.
|
|
|
// Missing buttons configured using learning function, which does not work well with RCx format due to the toggle bit,
|
|
|
// so i used an old unused IR remote with NEC code for these, which will be OK for non-repeating buttons.
|
|
|
+
|
|
|
+ // power
|
|
|
if (_currRC6Code == 0x270C) { // POWER (of SOURCE)
|
|
|
//handleButton_RCx(BTN_POWER, BUTTONMODE_REPEAT, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
- handlePowerButton();
|
|
|
+ //handlePowerButton();
|
|
|
+ handleButton_RCx(BTN_POWER, BUTTONMODE_REPEAT, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
}
|
|
|
+
|
|
|
+ // above control pad
|
|
|
+ else if (_currRC6Code == 0x2743) { // X - AUDIO PARAMETER - left above control pad
|
|
|
+ //handleButton_RCx(BTN_HOME, BUTTONMODE_ONCE, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
+ //handleTaskSwitchButton();
|
|
|
+ handleButton_RCx(BTN_TASKSWITCH, BUTTONMODE_REPEAT, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
+ }
|
|
|
+ else if (_currRC6Code == 0x2754) { // VIDEO PARAMETER - right above control pad
|
|
|
+ //handleButton_RCx(BTN_MENU, BUTTONMODE_ONCE, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
+ handleButton_RCx(BTN_CONTEXT, BUTTONMODE_ONCE, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
+ }
|
|
|
+
|
|
|
+ // control pad
|
|
|
else if (_currRC6Code == 0x275C) { // OK/ENTER
|
|
|
//handleButton_RCx(BTN_OK_ENTER, BUTTONMODE_ONCE, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
handleButton_RCx(BTN_OK_ENTER, BUTTONMODE_HOLD, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
}
|
|
|
- else if (_currRC6Code == 0x2783) { // RETURN/BACK - bottom right at control pad
|
|
|
- //handleButton_RCx(BTN_BACK, BUTTONMODE_ONCE, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
- handleButton_RCx(BTN_BACK, BUTTONMODE_HOLD, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
- }
|
|
|
else if (_currRC6Code == 0x275A) { // LEFT
|
|
|
//handleButton_RCx(BTN_LEFT, BUTTONMODE_REPEAT, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
- handleButton_RCx(BTN_LEFT, BUTTONMODE_HOLD, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
+ //handleButton_RCx(BTN_LEFT, BUTTONMODE_HOLD, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
+ handleButton_RCx(BTN_LEFT, BUTTONMODE_EXTENDED_REPEAT, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
}
|
|
|
else if (_currRC6Code == 0x275B) { // RIGHT
|
|
|
//handleButton_RCx(BTN_RIGHT, BUTTONMODE_REPEAT, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
- handleButton_RCx(BTN_RIGHT, BUTTONMODE_HOLD, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
+ //handleButton_RCx(BTN_RIGHT, BUTTONMODE_HOLD, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
+ handleButton_RCx(BTN_RIGHT, BUTTONMODE_EXTENDED_REPEAT, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
}
|
|
|
else if (_currRC6Code == 0x2758) { // UP
|
|
|
//handleButton_RCx(BTN_UP, BUTTONMODE_REPEAT, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
- handleButton_RCx(BTN_UP, BUTTONMODE_HOLD, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
+ //handleButton_RCx(BTN_UP, BUTTONMODE_HOLD, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
+ handleButton_RCx(BTN_UP, BUTTONMODE_EXTENDED_REPEAT, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
}
|
|
|
else if (_currRC6Code == 0x2759) { // DOWN
|
|
|
//handleButton_RCx(BTN_DOWN, BUTTONMODE_REPEAT, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
- handleButton_RCx(BTN_DOWN, BUTTONMODE_HOLD, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
+ //handleButton_RCx(BTN_DOWN, BUTTONMODE_HOLD, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
+ handleButton_RCx(BTN_DOWN, BUTTONMODE_EXTENDED_REPEAT, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
}
|
|
|
- else if (_currRC6Code == 0x27CC) { // HOME MENU - bottom left at control pad
|
|
|
+
|
|
|
+ // below control pad
|
|
|
+ else if (_currRC6Code == 0x27CC) { // HOME MENU - left below control pad
|
|
|
handleButton_RCx(BTN_MENU, BUTTONMODE_ONCE, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
}
|
|
|
- else if (_currRC6Code == 0x2743) { // X - AUDIO PARAMETER - top left at control pad
|
|
|
- //handleButton_RCx(BTN_HOME, BUTTONMODE_ONCE, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
- handleTaskSwitchButton();
|
|
|
- }
|
|
|
- else if (_currRC6Code == 0x2754) { // VIDEO PARAMETER - top right at control pad
|
|
|
- //handleButton_RCx(BTN_MENU, BUTTONMODE_ONCE, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
- handleButton_RCx(BTN_CONTEXT, BUTTONMODE_ONCE, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
+ else if (_currRC6Code == 0x2783) { // RETURN/BACK - right below control pad
|
|
|
+ //handleButton_RCx(BTN_BACK, BUTTONMODE_ONCE, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
+ handleButton_RCx(BTN_BACK, BUTTONMODE_HOLD, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
}
|
|
|
+
|
|
|
+ // media player controls
|
|
|
else if (_currRC6Code == 0x2771) { // PLAY
|
|
|
handleButton_RCx(BTN_PLAY, BUTTONMODE_ONCE, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
}
|
|
@@ -406,6 +475,8 @@ void dumpInfo (decode_results *results)
|
|
|
else if (_currRC6Code == 0x2770) { // NEXT
|
|
|
handleButton_RCx(BTN_NEXT, BUTTONMODE_ONCE, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
}
|
|
|
+
|
|
|
+ // number keys
|
|
|
else if (_currRC6Code == 0x2701) { // 1
|
|
|
handleButton_RCx(BTN_1, BUTTONMODE_ONCE, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
}
|
|
@@ -436,6 +507,8 @@ void dumpInfo (decode_results *results)
|
|
|
else if (_currRC6Code == 0x2700) { // 0
|
|
|
handleButton_RCx(BTN_0, BUTTONMODE_ONCE, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
}
|
|
|
+
|
|
|
+ // channel up/down
|
|
|
else if (_currRC6Code == 0x2720) { // CH+
|
|
|
handleButton_RCx(BTN_CH_UP, BUTTONMODE_ONCE, _currRC6Pref, REMOTETYPE_RC6);
|
|
|
}
|
|
@@ -459,43 +532,221 @@ void dumpInfo (decode_results *results)
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
// NEC CODES - used also for Pioneer remote codes here (Pioneer code consists of 2 NEC codes and is not directly supported by Arduino IRRemote.h)
|
|
|
else if (results->decode_type == NEC && results->bits == 32) {
|
|
|
|
|
|
// Pioneer Remote in BD mode, configured code preset to Sat-PVR/Philips 6139 (RC6 code)
|
|
|
// -> missing/unused buttons "learned" with codes in NEC format
|
|
|
if (results->value == 0x4FF18E7) { // RED
|
|
|
- handleButton(BTN_RED, false);
|
|
|
+ handleButton_NEC(BTN_RED, BUTTONMODE_ONCE);
|
|
|
}
|
|
|
else if (results->value == 0x4FF02FD) { // GREEN
|
|
|
- handleButton(BTN_GREEN, false);
|
|
|
+ handleButton_NEC(BTN_GREEN, BUTTONMODE_ONCE);
|
|
|
}
|
|
|
else if (results->value == 0x4FF827D) { // YELLOW
|
|
|
- handleButton(BTN_YELLOW, false);
|
|
|
+ handleButton_NEC(BTN_YELLOW, BUTTONMODE_ONCE);
|
|
|
}
|
|
|
else if (results->value == 0x4FF38C7) { // BLUE
|
|
|
- handleButton(BTN_BLUE, false);
|
|
|
+ handleButton_NEC(BTN_BLUE, BUTTONMODE_ONCE);
|
|
|
}
|
|
|
else if (results->value == 0x4FFB847) { // REWIND
|
|
|
- handleButton(BTN_REWD, false);
|
|
|
+ handleButton_NEC(BTN_REWD, BUTTONMODE_ONCE);
|
|
|
}
|
|
|
else if (results->value == 0x4FF08F7) { // FAST FORWARD
|
|
|
- handleButton(BTN_FFWD, false);
|
|
|
+ handleButton_NEC(BTN_FFWD, BUTTONMODE_ONCE);
|
|
|
}
|
|
|
else if (results->value == 0x4FF6897) { // ./CLR
|
|
|
- //handleButton(BTN_, false);
|
|
|
+ //handleButton_NEC(BTN_, BUTTONMODE_ONCE);
|
|
|
}
|
|
|
else if (results->value == 0x4FF9867) { // CLASS/ENTER
|
|
|
- handleButton(BTN_OK_ENTER, false);
|
|
|
+ handleButton_NEC(BTN_OK_ENTER, BUTTONMODE_ONCE);
|
|
|
}
|
|
|
else if (results->value == 0x4FFF807) { // AUDIO
|
|
|
- //handleButton(BTN_, false);
|
|
|
+ //handleButton_NEC(BTN_, BUTTONMODE_ONCE);
|
|
|
}
|
|
|
else if (results->value == 0x4FF7887) { // DISPLAY/INFO
|
|
|
- handleButton(BTN_INFO, false);
|
|
|
+ handleButton_NEC(BTN_INFO, BUTTONMODE_ONCE);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // TOSHIBA SE-R0319
|
|
|
+ // NEC 32bit codes
|
|
|
+ else if (results->value == 0x2FD48B7) { // POWER
|
|
|
+ handleButton_NEC(BTN_POWER, BUTTONMODE_REPEAT);
|
|
|
+ }
|
|
|
+ else if (results->value == 0x2FDA857) { // SLEEP
|
|
|
+ handleButton_NEC(BTN_SLEEP, BUTTONMODE_ONCE);
|
|
|
+ }
|
|
|
+
|
|
|
+ // above control pad
|
|
|
+ else if (results->value == 0x2FDCA35) { // left above control pad -> TASKSWITCH
|
|
|
+ handleButton_NEC(BTN_TASKSWITCH, BUTTONMODE_REPEAT);
|
|
|
+ }
|
|
|
+ else if (results->value == 0xA25D9E61) { // right above control pad -> CONTEXT
|
|
|
+ handleButton_NEC(BTN_CONTEXT, BUTTONMODE_ONCE);
|
|
|
+ }
|
|
|
+
|
|
|
+ // control pad
|
|
|
+ else if (results->value == 0x2FDBC43) { // ENTER
|
|
|
+ handleButton_NEC(BTN_OK_ENTER, BUTTONMODE_HOLD);
|
|
|
+ }
|
|
|
+ else if (results->value == 0x22DD8A75) { // LEFT
|
|
|
+ //handleButton_NEC(BTN_LEFT, BUTTONMODE_HOLD);
|
|
|
+ handleButton_NEC(BTN_LEFT, BUTTONMODE_EXTENDED_REPEAT);
|
|
|
+ }
|
|
|
+ else if (results->value == 0x22DDB24D) { // RIGHT
|
|
|
+ //handleButton_NEC(BTN_RIGHT, BUTTONMODE_HOLD);
|
|
|
+ handleButton_NEC(BTN_RIGHT, BUTTONMODE_EXTENDED_REPEAT);
|
|
|
+ }
|
|
|
+ else if (results->value == 0x2FD7C83) { // UP
|
|
|
+ //handleButton_NEC(BTN_UP, BUTTONMODE_HOLD);
|
|
|
+ handleButton_NEC(BTN_UP, BUTTONMODE_EXTENDED_REPEAT);
|
|
|
+ }
|
|
|
+ else if (results->value == 0x2FDFC03) { // DOWN
|
|
|
+ //handleButton_NEC(BTN_DOWN, BUTTONMODE_HOLD);
|
|
|
+ handleButton_NEC(BTN_DOWN, BUTTONMODE_EXTENDED_REPEAT);
|
|
|
+ }
|
|
|
+
|
|
|
+ // below control pad
|
|
|
+ else if (results->value == 0x2FD708F) { // left below control pad -> MENU
|
|
|
+ handleButton_NEC(BTN_MENU, BUTTONMODE_ONCE);
|
|
|
+ }
|
|
|
+ else if (results->value == 0x22DDF708) { // left below control pad -> BACK
|
|
|
+ handleButton_NEC(BTN_BACK, BUTTONMODE_ONCE);
|
|
|
+ }
|
|
|
+
|
|
|
+ // volume control
|
|
|
+ else if (results->value == 0x2FD58A7) { // VOL+
|
|
|
+ handleButton_NEC(BTN_VOL_UP, BUTTONMODE_REPEAT);
|
|
|
+ }
|
|
|
+ else if (results->value == 0x2FD7887) { // VOL-
|
|
|
+ handleButton_NEC(BTN_VOL_DOWN, BUTTONMODE_REPEAT);
|
|
|
+ }
|
|
|
+ else if (results->value == 0x2FD08F7) { // MUTE
|
|
|
+ handleButton_NEC(BTN_MUTE, BUTTONMODE_ONCE);
|
|
|
+ }
|
|
|
+
|
|
|
+ // media player controls
|
|
|
+ else if (results->value == 0x22DDA857) { // PLAY
|
|
|
+ handleButton_NEC(BTN_PLAY, BUTTONMODE_ONCE);
|
|
|
+ }
|
|
|
+ // else if (results->value == 0xA25DA857) { // PAUSE - combined with GREEN - unused as PLAY/PAUSE is 1 key anyway
|
|
|
+ // handleButton_NEC(BTN_PAUSE, BUTTONMODE_ONCE);
|
|
|
+ // }
|
|
|
+ else if (results->value == 0x22DD28D7) { // STOP
|
|
|
+ handleButton_NEC(BTN_STOP, BUTTONMODE_ONCE);
|
|
|
+ }
|
|
|
+ else if (results->value == 0xA25DC43B) { // PREV
|
|
|
+ handleButton_NEC(BTN_PREV, BUTTONMODE_ONCE);
|
|
|
+ }
|
|
|
+ else if (results->value == 0xA25D24DB) { // NEXT
|
|
|
+ handleButton_NEC(BTN_NEXT, BUTTONMODE_ONCE);
|
|
|
+ }
|
|
|
+ else if (results->value == 0xA25D9867) { // REWD
|
|
|
+ handleButton_NEC(BTN_REWD, BUTTONMODE_ONCE);
|
|
|
+ }
|
|
|
+ else if (results->value == 0xA25DC837) { // FFWD
|
|
|
+ handleButton_NEC(BTN_FFWD, BUTTONMODE_ONCE);
|
|
|
}
|
|
|
|
|
|
+ // number keys
|
|
|
+ else if (results->value == 0x2FD807F) { // 1
|
|
|
+ handleButton_NEC(BTN_1, BUTTONMODE_ONCE);
|
|
|
+ }
|
|
|
+ else if (results->value == 0x2FD40BF) { // 2
|
|
|
+ handleButton_NEC(BTN_2, BUTTONMODE_ONCE);
|
|
|
+ }
|
|
|
+ else if (results->value == 0x2FDC03F) { // 3
|
|
|
+ handleButton_NEC(BTN_3, BUTTONMODE_ONCE);
|
|
|
+ }
|
|
|
+ else if (results->value == 0x2FD20DF) { // 4
|
|
|
+ handleButton_NEC(BTN_4, BUTTONMODE_ONCE);
|
|
|
+ }
|
|
|
+ else if (results->value == 0x2FDA05F) { // 5
|
|
|
+ handleButton_NEC(BTN_5, BUTTONMODE_ONCE);
|
|
|
+ }
|
|
|
+ else if (results->value == 0x2FD609F) { // 6
|
|
|
+ handleButton_NEC(BTN_6, BUTTONMODE_ONCE);
|
|
|
+ }
|
|
|
+ else if (results->value == 0x2FDE01F) { // 7
|
|
|
+ handleButton_NEC(BTN_7, BUTTONMODE_ONCE);
|
|
|
+ }
|
|
|
+ else if (results->value == 0x2FD10EF) { // 8
|
|
|
+ handleButton_NEC(BTN_8, BUTTONMODE_ONCE);
|
|
|
+ }
|
|
|
+ else if (results->value == 0x2FD906F) { // 9
|
|
|
+ handleButton_NEC(BTN_9, BUTTONMODE_ONCE);
|
|
|
+ }
|
|
|
+ else if (results->value == 0x2FD00FF) { // 0
|
|
|
+ handleButton_NEC(BTN_0, BUTTONMODE_ONCE);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ // color keys
|
|
|
+ else if (results->value == 0xA25D708F) { // RED (also SLOW REWD)
|
|
|
+ handleButton_NEC(BTN_RED, BUTTONMODE_ONCE);
|
|
|
+ }
|
|
|
+ else if (results->value == 0xA25DA857) { // GREEN (also PAUSE)
|
|
|
+ handleButton_NEC(BTN_GREEN, BUTTONMODE_ONCE);
|
|
|
+ }
|
|
|
+ else if (results->value == 0xA25D07F8) { // YELLOW (also PLAY MODE)
|
|
|
+ handleButton_NEC(BTN_YELLOW, BUTTONMODE_ONCE);
|
|
|
+ }
|
|
|
+ else if (results->value == 0xA25DB04F) { // BLUE (also SLOW FWD)
|
|
|
+ handleButton_NEC(BTN_BLUE, BUTTONMODE_ONCE);
|
|
|
+ }
|
|
|
+
|
|
|
+ // other
|
|
|
+ else if (results->value == 0x2FD38C7) { // DISPLAY
|
|
|
+ handleButton_NEC(BTN_INFO, BUTTONMODE_ONCE);
|
|
|
+ }
|
|
|
+ // else if (results->value == 0xA23DCD32) { // TV/DVD
|
|
|
+ // handleButton_NEC(BTN_INFO, BUTTONMODE_ONCE);
|
|
|
+ // }
|
|
|
+ // else if (results->value == 0xA25DAF50) { // EJECT
|
|
|
+ // handleButton_NEC(BTN_INFO, BUTTONMODE_ONCE);
|
|
|
+ // }
|
|
|
+ // else if (results->value == 0x22DDE11E) { // SUBTITLE
|
|
|
+ // handleButton_NEC(BTN_INFO, BUTTONMODE_ONCE);
|
|
|
+ // }
|
|
|
+ // else if (results->value == 0x2FDF00F) { // INPUT
|
|
|
+ // handleButton_NEC(BTN_INFO, BUTTONMODE_ONCE);
|
|
|
+ // }
|
|
|
+ // else if (results->value == 0x2FD9867) { // MENU/DVD
|
|
|
+ // handleButton_NEC(BTN_INFO, BUTTONMODE_ONCE);
|
|
|
+ // }
|
|
|
+ // else if (results->value == 0x22DDFB04) { // MENU/TOP
|
|
|
+ // handleButton_NEC(BTN_INFO, BUTTONMODE_ONCE);
|
|
|
+ // }
|
|
|
+ // else if (results->value == 0x22DDCA35) { // AUDIO SELECT
|
|
|
+ // handleButton_NEC(BTN_INFO, BUTTONMODE_ONCE);
|
|
|
+ // }
|
|
|
+ // else if (results->value == 0xA25D02FD) { // CH.RTN/ZOOM
|
|
|
+ // handleButton_NEC(BTN_INFO, BUTTONMODE_ONCE);
|
|
|
+ // }
|
|
|
+ // else if (results->value == 0x22DDBA45) { // RETURN (next to PLAY)
|
|
|
+ // handleButton_NEC(BTN_INFO, BUTTONMODE_ONCE);
|
|
|
+ // }
|
|
|
+ // else if (results->value == 0xA25D37C8) { // MARKER
|
|
|
+ // handleButton_NEC(BTN_INFO, BUTTONMODE_ONCE);
|
|
|
+ // }
|
|
|
+ // else if (results->value == 0x22DD6996) { // ANGLE
|
|
|
+ // handleButton_NEC(BTN_INFO, BUTTONMODE_ONCE);
|
|
|
+ // }
|
|
|
+ // else if (results->value == 0x22DD3AC5) { // REPEAT A+B
|
|
|
+ // handleButton_NEC(BTN_INFO, BUTTONMODE_ONCE);
|
|
|
+ // }
|
|
|
+ // else if (results->value == 0x22DDD926) { // JUMP
|
|
|
+ // handleButton_NEC(BTN_INFO, BUTTONMODE_ONCE);
|
|
|
+ // }
|
|
|
+ // else if (results->value == 0x2FD9A65) { // PIC SIZE
|
|
|
+ // handleButton_NEC(BTN_INFO, BUTTONMODE_ONCE);
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -611,11 +862,24 @@ void dumpInfo (decode_results *results)
|
|
|
// else if (lastNECcode == 0xD52A34CB && results->value == 0xF50AA758) { // ./CLR/D.ACCESS
|
|
|
// //handleButton(BTN_POWER, false);
|
|
|
// }
|
|
|
+ // remember last NEC code - for PIONEER remotes sending 2 NEC codes as one PIONEER code
|
|
|
+ //lastNECcode = results->value;
|
|
|
+
|
|
|
+
|
|
|
+ else {
|
|
|
+ // unknown / not implemented NEC code -> must reset last key or a repeat of this unknown key will trigger the last one
|
|
|
+ handleButton_NEC(BTN_UNKNOWN, BUTTONMODE_REPEAT);
|
|
|
+ }
|
|
|
|
|
|
- // remember last NEC code
|
|
|
- lastNECcode = results->value;
|
|
|
} // END NEC CODES
|
|
|
|
|
|
+ // NEC repetitions (0 bits)
|
|
|
+ // RC using NEC code send a 0 bit NEC code as repetition after the actual key press
|
|
|
+ else if (results->decode_type == NEC && results->bits == 0) {
|
|
|
+ if (debug) Serial.println(F("NEC REPETITION"));
|
|
|
+ handleButton_NEC(BTN_REPETITION, BUTTONMODE_LAST);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|