Mute has no slot on the page (Vol- / Play / Vol+ fills the row), so it lives under the volume-down key: a short press on Vol- is still exactly one VolumeDown, a hold is one VolumeMute. This rides the keyboard's own long-press path rather than a timer of its own. KeyModifier.modify_long_press() maps ROKU_VOLDOWN to KeyValue.ROKU_VOLUME_MUTE - the same route CHANGE_METHOD_PREV/NEXT and SWITCH_VOICE_TYPING already take - so Pointers.handleLongPress() replaces the pointer's value at longpress_timeout and the single key_up on release carries the mute. VolumeDown is never sent on a hold because events are dispatched only from key_up (KeyEventHandler), which reads the pointer's value after the replacement; and if the finger lifts first, onTouchUp stops the pending long-press before reading the value, so the swap never happens. KeyValue.ROKU_VOLUME_MUTE is one shared key: the 'roku_volmute' name and the long press both return it, so the two cannot drift apart. The Roku page needs no XML change for this. The long-press delay is _config.longPressTimeout, the fork's longpress_timeout setting, the same as every other long-pressable key.
42 lines
1.8 KiB
XML
42 lines
1.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- The Roku remote page. Not a user-selectable layout: it is opened by the
|
|
switch_roku key and left with roku_close. Every key above the last row sends
|
|
an HTTP keypress to the TV (see RokuRemote) instead of typing.
|
|
|
|
This page carries nothing but remote keys. It is loaded as a plain layout
|
|
(Keyboard2.loadRokuLayout), NOT through LayoutModifier.modify_layout, so the
|
|
forced config key and the configured extra keys do not land on it and do not
|
|
fill the empty corner slots of these keys. That is why the last row is a
|
|
full-width "Keyboard" key instead of the config gear: it fires the same
|
|
Event.SWITCH_TEXT as the switch_text key on other pages and is the way back
|
|
to the letter keyboard.
|
|
|
|
Vol- is also the page's mute: holding it sends mute instead of volume-down
|
|
(KeyModifier.modify_long_press), so mute is on the page without a slot. -->
|
|
<keyboard bottom_row="false">
|
|
<row height="0.8">
|
|
<key width="3.3" role="action" key0="roku_home"/>
|
|
<key width="3.3" role="action" key0="roku_back"/>
|
|
<key width="3.3" role="action" key0="roku_power"/>
|
|
</row>
|
|
<row height="0.8">
|
|
<key shift="3.3" width="3.3" role="action" key0="roku_up"/>
|
|
</row>
|
|
<row height="0.8">
|
|
<key width="3.3" role="action" key0="roku_left"/>
|
|
<key width="3.3" role="action" key0="roku_select"/>
|
|
<key width="3.3" role="action" key0="roku_right"/>
|
|
</row>
|
|
<row height="0.8">
|
|
<key shift="3.3" width="3.3" role="action" key0="roku_down"/>
|
|
</row>
|
|
<row height="0.8">
|
|
<key width="3.3" role="action" key0="roku_voldown"/>
|
|
<key width="3.3" role="action" key0="roku_play"/>
|
|
<key width="3.3" role="action" key0="roku_volup"/>
|
|
</row>
|
|
<row height="1.0">
|
|
<key width="9.9" role="action" key0="roku_close"/>
|
|
</row>
|
|
</keyboard>
|