diff --git a/app/src/main/java/com/valterc/ki2/data/action/KarooAction.java b/app/src/main/java/com/valterc/ki2/data/action/KarooAction.java
index 07e979f..ffd183c 100644
--- a/app/src/main/java/com/valterc/ki2/data/action/KarooAction.java
+++ b/app/src/main/java/com/valterc/ki2/data/action/KarooAction.java
@@ -27,7 +27,8 @@ public enum KarooAction {
VIRTUAL_LAP,
VIRTUAL_ZOOM_OUT,
VIRTUAL_ZOOM_IN,
- VIRTUAL_CONTROL_CENTER;
+ VIRTUAL_CONTROL_CENTER,
+ VIRTUAL_DRAWER_ACTION;
private static final KarooAction[] values = KarooAction.values();
diff --git a/app/src/main/java/com/valterc/ki2/input/ActionAdapter.java b/app/src/main/java/com/valterc/ki2/input/ActionAdapter.java
index 54416f6..6010894 100644
--- a/app/src/main/java/com/valterc/ki2/input/ActionAdapter.java
+++ b/app/src/main/java/com/valterc/ki2/input/ActionAdapter.java
@@ -54,6 +54,7 @@ public ActionAdapter(Ki2ExtensionContext context) {
this.keyMapping.put(KarooAction.VIRTUAL_ZOOM_IN, karooKeyEvent -> context.getKarooSystem().dispatch(new ZoomPage(true)));
this.keyMapping.put(KarooAction.VIRTUAL_ZOOM_OUT, karooKeyEvent -> context.getKarooSystem().dispatch(new ZoomPage(false)));
this.keyMapping.put(KarooAction.VIRTUAL_CONTROL_CENTER, karooKeyEvent -> context.getKarooSystem().dispatch(PerformHardwareAction.ControlCenterComboPress.INSTANCE));
+ this.keyMapping.put(KarooAction.VIRTUAL_DRAWER_ACTION, karooKeyEvent -> context.getKarooSystem().dispatch(PerformHardwareAction.DrawerActionComboPress.INSTANCE));
}
private void showToast(Ki2ExtensionContext context, int textResId) {
diff --git a/app/src/main/java/com/valterc/ki2/input/InputManager.java b/app/src/main/java/com/valterc/ki2/input/InputManager.java
index a42b9b0..e99767f 100644
--- a/app/src/main/java/com/valterc/ki2/input/InputManager.java
+++ b/app/src/main/java/com/valterc/ki2/input/InputManager.java
@@ -56,6 +56,7 @@ public class InputManager {
preferenceToSwitchKeyMap.put("press_double_beep", (switchEvent, converter) -> new KarooActionEvent(KarooAction.VIRTUAL_DOUBLE_BEEP, switchEvent.getRepeat()));
preferenceToSwitchKeyMap.put("press_bell", (switchEvent, converter) -> new KarooActionEvent(KarooAction.VIRTUAL_BELL, switchEvent.getRepeat()));
preferenceToSwitchKeyMap.put("press_control_center", (switchEvent, converter) -> new KarooActionEvent(KarooAction.VIRTUAL_CONTROL_CENTER, switchEvent.getRepeat()));
+ preferenceToSwitchKeyMap.put("press_drawer_action", (switchEvent, converter) -> new KarooActionEvent(KarooAction.VIRTUAL_DRAWER_ACTION, switchEvent.getRepeat()));
preferenceToSwitchKeyMap.put("press_toggle_overlay", (switchEvent, converter) -> new KarooActionEvent(KarooAction.VIRTUAL_TOGGLE_OVERLAY, switchEvent.getRepeat()));
preferenceToSwitchKeyMap.put("press_hide_overlay", (switchEvent, converter) -> new KarooActionEvent(KarooAction.VIRTUAL_HIDE_OVERLAY, switchEvent.getRepeat()));
preferenceToSwitchKeyMap.put("press_show_overlay", (switchEvent, converter) -> new KarooActionEvent(KarooAction.VIRTUAL_SHOW_OVERLAY, switchEvent.getRepeat()));
@@ -104,6 +105,13 @@ public class InputManager {
return new KarooActionEvent(KarooAction.VIRTUAL_CONTROL_CENTER, 0);
});
+ preferenceToSwitchKeyMap.put("hold_short_single_drawer_action", (switchEvent, converter) -> {
+ if (switchEvent.getCommand() != SwitchCommand.LONG_PRESS_DOWN) {
+ return null;
+ }
+
+ return new KarooActionEvent(KarooAction.VIRTUAL_DRAWER_ACTION, 0);
+ });
preferenceToSwitchKeyMap.put("map_graph_slow_zoom_out", (switchEvent, converter) -> {
if (switchEvent.getCommand() == SwitchCommand.LONG_PRESS_UP ||
(switchEvent.getCommand() == SwitchCommand.LONG_PRESS_CONTINUE && switchEvent.getRepeat() % 2 != 0)) {
diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml
index 7d00f45..d4c7ea0 100644
--- a/app/src/main/res/values/arrays.xml
+++ b/app/src/main/res/values/arrays.xml
@@ -21,6 +21,7 @@
- Double Beep
- Bell
- Control Center
+ - Drawer
@@ -45,6 +46,7 @@
- press_double_beep
- press_bell
- press_control_center
+ - press_drawer_action
@@ -70,6 +72,7 @@
- Double Beep
- Bell
- Control Center
+ - Drawer
@@ -95,6 +98,7 @@
- press_double_beep
- press_bell
- press_control_center
+ - press_drawer_action
@@ -122,6 +126,7 @@
- Double Beep
- Bell
- Control Center
+ - Drawer
- Continuous Single Beep
- Continuous Bell
@@ -151,6 +156,7 @@
- hold_short_single_double_beep
- hold_short_single_bell
- hold_short_single_control_center
+ - hold_short_single_drawer_action
- hold_continuous_single_beep
- hold_continuous_bell