Cyril

Cross-Platform Remote-Effort

Goal:
One Harmony activity, different desktop environments/sessions (Windows, Linux, & Kodi).

Challenge:

  1. A range of MCE-IR commands are not interpreted by linux or kodi without trickery.
  2. Sleep/suspend command is different for each desktop environment.

Solution:

  1. FLIRC translates MCE-IR signals into keystrokes that are readily interpreted by all.
    This eliminates the need for obscure harmony devices, and/or trickery.
  2. Don’t use any of the off-the-shelf ir shutdown commands
    a. Harmony sends ots [FLIRC-powerOff] ir-command
    b. FLIRC translates ir-command to someKeystroke
    c. desktop environment interprets someKeystroke to appropriate suspend-command

Proof of concept:
Kodi harmony FLIRC power issue (2015)

Definitions:

[suspend-keystroke] := alt+backslash
[suspend-command, linux] := systemctl suspend
[suspend-command, windows] := %windir%\System32\rundll32.exe powrprof.dll,SetSuspendState 0,1,0

Assign [suspend command] to [keystroke]

Gnome (& maybe Pantheon):
settings > devices > keyboard
[suspend-keystroke] := [suspend-command, linux]
Windows:
create shortcut in user’s desktop
enter [suspend-command, windows] as location of item
assign [suspend-keystroke] to ‘shortcut key’ of shortcut
kodi:
This will only suspend a system if kodi is the focused application, but is cross-platform functional.
create entry in keymap.xml, assigning [suspend-keystroke] to (kodi’s) sleep function.
Example:
userdata\keymaps\keymap.xml

<?xml version="1.0" encoding="UTF-8"?>
<keymap>
  <global>
	<keyboard>
  	<backslash mod="alt">Suspend()</backslash>
  	<t mod="shift,alt">PlayPvrTV</t>
	</keyboard>
  </global>
</keymap>

FLIRC & Harmony

MyHarmony:

FLIRC:
link FLIRC’s [power-off] signal to [suspend-keystroke]

Notes:

Un-explored:
Determine what the keyboard (logitech k400) power button is outputting (using ‘xev’?)
xev -event keyboard
link the command to a keystroke via kodi keymap file.

Notes:
FLIRC, support
other FLIRC support
kodi shortcuts to use

keystroke function
p play
space play/pause
x stop
e epg
ctrl+r record
h channel list
c context menu
i info
k pvr
0 (zero) toggle last two channels
f fast forward
r rewind
backspace back

find usb keyboard id’s
https://superuser.com/a/552026
WMC shortcuts
https://technet.microsoft.com/en-us/library/ff404226.aspx
http://tweaks.com/windows/39108/windows-media-center-keyboard-shortcuts/
https://www.simplehelp.net/2008/06/18/42-keyboard-shortcuts-for-controlling-windows-media-center/
Devices to use with Harmony
anyware:gp-ir02bk (mce remote)
FLIRC:kodi

Other:

kodi doesn’t respond to some rc6 commands because they are broadcast beyond kodi’s ir spectrum.
The easy route is FLIRC, which internally translates the ir codes, and output’s them to the PC as standard keyboard codes (super universal). Also, with FLIRC & harmony remote, I am freed from rc6/kodi/linux incompatibilities.
Regarding Windows, getting Kodi to see the missing rc6 codes directly involves a registry hack, and some old un-supported software “Advanced MCE Remote Mapper Tool”.
*other list of hacky options
Regarding Linux, there’s a dance with ir-keytables and some services.