Support new braille display model: Activator
Change-Id: I3e90d23b719cced7f3b86d101758790071850e8e
diff --git a/Drivers/Braille/HID/braille.c b/Drivers/Braille/HID/braille.c
index ab3fb4d..9617e7f 100644
--- a/Drivers/Braille/HID/braille.c
+++ b/Drivers/Braille/HID/braille.c
@@ -158,12 +158,15 @@
inputReportBit += reportSize * reportCount;
continue;
}
- // Fail if we get a usage of unexpected type or size
- if (reportSize != 1) {
- logMessage(LOG_ERR, "Unexpected input item input size %u != 1",
- reportSize);
- parsingError = 1;
- break;
+ // Ignore INPUT for the "Number of Braille Cells" usage.
+ // The display may send this INPUT message to indicate how many Braille
+ // cells we are allowed to write to at the moment, but this driver
+ // does not currently respect that request and always uses all Braille
+ // cells indicated by the OUTPUT report.
+ if (usagePage == HID_UPG_Braille &&
+ usages[0] == HID_USG_BRL_CellCount) {
+ inputReportBit += reportSize * reportCount;
+ continue;
}
if ((item.value.u & HID_USG_FLG_VARIABLE) != HID_USG_FLG_VARIABLE) {
logMessage(LOG_ERR, "Unexpected non-variable input item");
diff --git a/Drivers/Braille/HID/brldefs-hid.h b/Drivers/Braille/HID/brldefs-hid.h
index ae0c998..534aa15 100644
--- a/Drivers/Braille/HID/brldefs-hid.h
+++ b/Drivers/Braille/HID/brldefs-hid.h
@@ -23,7 +23,9 @@
HID_KEY_Dot7,
HID_KEY_Dot8,
HID_KEY_Space,
-
+ HID_KEY_SpaceLeft,
+ HID_KEY_SpaceRight,
+
HID_KEY_PanLeft,
HID_KEY_PanRight,
@@ -35,7 +37,14 @@
HID_KEY_RockerUp,
HID_KEY_RockerDown,
+ HID_KEY_RockerPress,
+ HID_KEY_JoystickCenter,
+ HID_KEY_JoystickUp,
+ HID_KEY_JoystickDown,
+ HID_KEY_JoystickLeft,
+ HID_KEY_JoystickRight,
+
HID_KEY_ROUTING,
} HID_Keys;
@@ -50,6 +59,8 @@
{HID_USG_BRL_KeyboardDot7, HID_KEY_Dot7},
{HID_USG_BRL_KeyboardDot8, HID_KEY_Dot8},
{HID_USG_BRL_KeyboardSpace, HID_KEY_Space},
+ {HID_USG_BRL_KeyboardLeftSpace, HID_KEY_SpaceLeft},
+ {HID_USG_BRL_KeyboardRightSpace, HID_KEY_SpaceRight},
{HID_USG_BRL_PanLeft, HID_KEY_PanLeft},
{HID_USG_BRL_PanRight, HID_KEY_PanRight},
{HID_USG_BRL_DPadUp, HID_KEY_DPadUp},
@@ -59,6 +70,12 @@
{HID_USG_BRL_DPadCenter, HID_KEY_DPadCenter},
{HID_USG_BRL_RockerUp, HID_KEY_RockerUp},
{HID_USG_BRL_RockerDown, HID_KEY_RockerDown},
+ {HID_USG_BRL_RockerPress, HID_KEY_RockerPress},
+ {HID_USG_BRL_JoystickCenter, HID_KEY_JoystickCenter},
+ {HID_USG_BRL_JoystickUp, HID_KEY_JoystickUp},
+ {HID_USG_BRL_JoystickDown, HID_KEY_JoystickDown},
+ {HID_USG_BRL_JoystickLeft, HID_KEY_JoystickLeft},
+ {HID_USG_BRL_JoystickRight, HID_KEY_JoystickRight},
// Router keys are handled separately.
};
int KEY_MAP_COUNT = sizeof(KEY_MAP) / sizeof(KEY_MAP[0]);
@@ -76,6 +93,8 @@
{.value.number = HID_KEY_Dot7, .name = "Dot7"},
{.value.number = HID_KEY_Dot8, .name = "Dot8"},
{.value.number = HID_KEY_Space, .name = "Space"},
+ {.value.number = HID_KEY_SpaceLeft, .name = "SpaceLeft"},
+ {.value.number = HID_KEY_SpaceRight, .name = "SpaceRight"},
{.value.number = HID_KEY_PanLeft, .name = "PanLeft"},
{.value.number = HID_KEY_PanRight, .name = "PanRight"},
{.value.number = HID_KEY_DPadUp, .name = "DPadUp"},
@@ -85,6 +104,12 @@
{.value.number = HID_KEY_DPadCenter, .name = "DPadCenter"},
{.value.number = HID_KEY_RockerUp, .name = "RockerUp"},
{.value.number = HID_KEY_RockerDown, .name = "RockerDown"},
+ {.value.number = HID_KEY_RockerPress, .name = "RockerPress"},
+ {.value.number = HID_KEY_JoystickCenter, .name = "JoystickCenter"},
+ {.value.number = HID_KEY_JoystickUp, .name = "JoystickUp"},
+ {.value.number = HID_KEY_JoystickDown, .name = "JoystickDown"},
+ {.value.number = HID_KEY_JoystickLeft, .name = "JoystickLeft"},
+ {.value.number = HID_KEY_JoystickRight, .name = "JoystickRight"},
{.value = {.group = HID_GRP_RoutingKeys, .number = KTB_KEY_ANY},
.name = "RoutingKey"},
{.name = NULL}};
diff --git a/Tables.brailleback/hid/HID.ktb b/Tables.brailleback/hid/HID.ktb
index 9b62d39..6ed66af 100644
--- a/Tables.brailleback/hid/HID.ktb
+++ b/Tables.brailleback/hid/HID.ktb
@@ -5,32 +5,42 @@
bind RoutingKey ROUTE:ROUTE+128
map Space SPACE
+map SpaceLeft SPACE
+map SpaceRight SPACE
note Panning and Rocker keys
note PanLeft/RockerUp move the Braille cell window left
note PanRight/RockerDown move the Braille cell window right
-assign panLeft PanLeft
-bind \{panLeft} FWINLT
-assign panRight PanRight
-bind \{panRight} FWINRT
-assign rockerUp RockerUp
-bind \{rockerUp} FWINLT
-assign rockerDown RockerDown
-bind \{rockerDown} FWINRT
+bind PanLeft FWINLT
+bind PanRight FWINRT
+bind RockerUp FWINLT
+bind RockerDown FWINRT
+bind RockerPress KEY_ENTER
note D-Pad
note DPadLeft moves to previous item, DPadRight moves to next item
note DPadUp moves up a line, DPadDown moves down a line
note DPadCenter is KEY_ENTER
-assign dpadLeft DPadLeft
-bind \{dpadLeft} CHRLT
-assign dpadRight DPadRight
-bind \{dpadRight} CHRRT
-assign dpadLeft DPadUp
-bind \{dpadLeft} LNUP
-assign dpadRight DPadDown
-bind \{dpadRight} LNDN
-assign dpadCenter DPadCenter
-bind \{dpadCenter} KEY_ENTER
+bind DPadLeft CHRLT
+bind DPadRight CHRRT
+bind DPadUp LNUP
+bind DPadDown LNDN
+bind DPadCenter KEY_ENTER
-include ../android-chords.kti
\ No newline at end of file
+note Joystick
+note JoystickLeft moves the Braille cell window left, JoystickRight move the Braille cell window right
+note JoystickUp moves up a line, JoystickDown moves down a line
+note JoystickCenter is KEY_ENTER
+bind JoystickUp LNUP
+bind JoystickDown LNDN
+bind JoystickLeft FWINLT
+bind JoystickRight FWINRT
+bind JoystickCenter KEY_ENTER
+
+assign chord Space
+include ../android-chords.kti
+assign chord SpaceLeft
+include ../android-chords.kti
+assign chord SpaceRight
+
+include ../android-chords.kti
diff --git a/Tables.brailleback/ht/ac4.ktb b/Tables.brailleback/ht/ac4.ktb
index cc1d6da..0ee71c4 100644
--- a/Tables.brailleback/ht/ac4.ktb
+++ b/Tables.brailleback/ht/ac4.ktb
@@ -51,3 +51,23 @@
include ../bm/display6.kti
include ../bm/routing6.kti
+
+
+########################
+# BrailleBack Bindings #
+########################
+
+# ROUTE+128 is a long-press on the routing key.
+bind RoutingKey ROUTE:ROUTE+128
+
+assign space SpaceLeft
+include dots.kti
+
+assign space SpaceRight
+include dots.kti
+
+assign space SpaceLeft
+include input.kti
+
+assign space SpaceRight
+include input.kti