Skip to content

Commit

Permalink
allow info key override on iOS remote
Browse files Browse the repository at this point in the history
  • Loading branch information
a1224 committed May 9, 2023
1 parent 079c323 commit 1e17ef8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
}
}
},
"infoKeyOverride": {
"name": "Info Key Override Keycode",
"type": "string",
"default": "KEYCODE_INFO"
},
"keys": {
"type": "array",
"items": {
Expand Down
2 changes: 1 addition & 1 deletion src/homebridge/platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1e17ef8

Please sign in to comment.