Commit 0aebfdac authored by Vojtech Pavlik's avatar Vojtech Pavlik Committed by Dmitry Torokhov

Input: add HID simulation mappings

Add simulation usage page mappings to hid-input.c to support
a new crop of joysticks using them to designate Rudder and
Throttle controls.
Signed-off-by: default avatarVojtech Pavlik <vojtech@suse.cz>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent b8c9c642
...@@ -85,6 +85,23 @@ static const struct hid_usage_entry hid_usage_table[] = { ...@@ -85,6 +85,23 @@ static const struct hid_usage_entry hid_usage_table[] = {
{0, 0x91, "D-PadDown"}, {0, 0x91, "D-PadDown"},
{0, 0x92, "D-PadRight"}, {0, 0x92, "D-PadRight"},
{0, 0x93, "D-PadLeft"}, {0, 0x93, "D-PadLeft"},
{ 2, 0, "Simulation" },
{0, 0xb0, "Aileron"},
{0, 0xb1, "AileronTrim"},
{0, 0xb2, "Anti-Torque"},
{0, 0xb3, "Autopilot"},
{0, 0xb4, "Chaff"},
{0, 0xb5, "Collective"},
{0, 0xb6, "DiveBrake"},
{0, 0xb7, "ElectronicCountermeasures"},
{0, 0xb8, "Elevator"},
{0, 0xb9, "ElevatorTrim"},
{0, 0xba, "Rudder"},
{0, 0xbb, "Throttle"},
{0, 0xbc, "FlightCommunications"},
{0, 0xbd, "FlareRelease"},
{0, 0xbe, "LandingGear"},
{0, 0xbf, "ToeBrake"},
{ 7, 0, "Keyboard" }, { 7, 0, "Keyboard" },
{ 8, 0, "LED" }, { 8, 0, "LED" },
{0, 0x01, "NumLock"}, {0, 0x01, "NumLock"},
......
...@@ -131,6 +131,15 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel ...@@ -131,6 +131,15 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
map_key(code); map_key(code);
break; break;
case HID_UP_SIMULATION:
switch (usage->hid & 0xffff) {
case 0xba: map_abs(ABS_RUDDER); break;
case 0xbb: map_abs(ABS_THROTTLE); break;
}
break;
case HID_UP_GENDESK: case HID_UP_GENDESK:
if ((usage->hid & 0xf0) == 0x80) { /* SystemControl */ if ((usage->hid & 0xf0) == 0x80) { /* SystemControl */
......
...@@ -173,6 +173,7 @@ struct hid_item { ...@@ -173,6 +173,7 @@ struct hid_item {
#define HID_UP_UNDEFINED 0x00000000 #define HID_UP_UNDEFINED 0x00000000
#define HID_UP_GENDESK 0x00010000 #define HID_UP_GENDESK 0x00010000
#define HID_UP_SIMULATION 0x00020000
#define HID_UP_KEYBOARD 0x00070000 #define HID_UP_KEYBOARD 0x00070000
#define HID_UP_LED 0x00080000 #define HID_UP_LED 0x00080000
#define HID_UP_BUTTON 0x00090000 #define HID_UP_BUTTON 0x00090000
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment