From 1e17ef8f8f4a87c6508f97def1ab57f9954f7514 Mon Sep 17 00:00:00 2001 From: a1224 <6486857+a1224@users.noreply.github.com> Date: Mon, 8 May 2023 21:45:37 -0700 Subject: [PATCH] allow info key override on iOS remote --- README.md | 9 +++++++++ config.schema.json | 5 +++++ src/homebridge/platform.js | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 94a5a71..f8313a7 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,15 @@ Example for keys : ] } ``` + +Replace "Info" button on the remote: + +```json +{ + "infoKeyOverride": "KEYCODE_HOME" +} +``` + Key code are listed here: * [android.com/reference/android/view/KeyEvent](https://developer.android.com/reference/android/view/KeyEvent?hl=fr) * [androidtv-remote/src/remote/remotemessage.proto#L88](https://github.com/louis49/androidtv-remote/blob/6ff7a73f2db53da4129c809cde9c616b9babde72/src/remote/remotemessage.proto#L88) diff --git a/config.schema.json b/config.schema.json index 8a5d092..d8530ea 100644 --- a/config.schema.json +++ b/config.schema.json @@ -34,6 +34,11 @@ } } }, + "infoKeyOverride": { + "name": "Info Key Override Keycode", + "type": "string", + "default": "KEYCODE_INFO" + }, "keys": { "type": "array", "items": { diff --git a/src/homebridge/platform.js b/src/homebridge/platform.js index 4993e4d..62c6e66 100644 --- a/src/homebridge/platform.js +++ b/src/homebridge/platform.js @@ -23,7 +23,7 @@ class AndroidTV { this.keys[this.api.hap.Characteristic.RemoteKey.BACK] = RemoteKeyCode.KEYCODE_BACK; this.keys[this.api.hap.Characteristic.RemoteKey.EXIT] = RemoteKeyCode.KEYCODE_HOME; this.keys[this.api.hap.Characteristic.RemoteKey.PLAY_PAUSE] = RemoteKeyCode.KEYCODE_MEDIA_PLAY_PAUSE; - this.keys[this.api.hap.Characteristic.RemoteKey.INFORMATION] = RemoteKeyCode.KEYCODE_INFO; + this.keys[this.api.hap.Characteristic.RemoteKey.INFORMATION] = this.config.infoKeyOverride ? RemoteKeyCode[this.config.infoKeyOverride] : RemoteKeyCode.KEYCODE_INFO; this.channelskeys = {}; this.channelskeys[0] = RemoteKeyCode.KEYCODE_0;