Fix T101866: Incorrect buttons for space-mouse enterprise

Use key from spacenavd's wiki.

Also add keys: ENTER, DELETE, TAB, SPACE & Views 1-3.
This commit is contained in:
Campbell Barton
2022-10-19 12:52:58 +11:00
parent 8aca40652a
commit ecda118be4
4 changed files with 118 additions and 40 deletions

View File

@@ -99,13 +99,6 @@ static const EnumPropertyItem event_ndof_type_items[] = {
{NDOF_BUTTON_DOMINANT, "NDOF_BUTTON_DOMINANT", 0, "Dominant", ""},
{NDOF_BUTTON_PLUS, "NDOF_BUTTON_PLUS", 0, "Plus", ""},
{NDOF_BUTTON_MINUS, "NDOF_BUTTON_MINUS", 0, "Minus", ""},
# if 0 /* Never used (converted to keyboard events by GHOST). */
/* keyboard emulation */
{NDOF_BUTTON_ESC, "NDOF_BUTTON_ESC", 0, "Esc"},
{NDOF_BUTTON_ALT, "NDOF_BUTTON_ALT", 0, "Alt"},
{NDOF_BUTTON_SHIFT, "NDOF_BUTTON_SHIFT", 0, "Shift"},
{NDOF_BUTTON_CTRL, "NDOF_BUTTON_CTRL", 0, "Ctrl"},
# endif
/* general-purpose buttons */
{NDOF_BUTTON_1, "NDOF_BUTTON_1", 0, "Button 1", ""},
{NDOF_BUTTON_2, "NDOF_BUTTON_2", 0, "Button 2", ""},
@@ -120,6 +113,21 @@ static const EnumPropertyItem event_ndof_type_items[] = {
{NDOF_BUTTON_A, "NDOF_BUTTON_A", 0, "Button A", ""},
{NDOF_BUTTON_B, "NDOF_BUTTON_B", 0, "Button B", ""},
{NDOF_BUTTON_C, "NDOF_BUTTON_C", 0, "Button C", ""},
/* View buttons. */
{NDOF_BUTTON_V1, "NDOF_BUTTON_V1", 0, "View 1", ""},
{NDOF_BUTTON_V2, "NDOF_BUTTON_V2", 0, "View 2", ""},
{NDOF_BUTTON_V3, "NDOF_BUTTON_V3", 0, "View 3", ""},
# if 0 /* Never used (converted to keyboard events by GHOST). */
/* keyboard emulation */
{NDOF_BUTTON_ESC, "NDOF_BUTTON_ESC", 0, "Esc"},
{NDOF_BUTTON_ENTER, "NDOF_BUTTON_ENTER", 0, "Enter"},
{NDOF_BUTTON_DELETE, "NDOF_BUTTON_DELETE", 0, "Delete"},
{NDOF_BUTTON_TAB, "NDOF_BUTTON_TAB", 0, "Tab"},
{NDOF_BUTTON_SPACE, "NDOF_BUTTON_SPACE", 0, "Space"},
{NDOF_BUTTON_ALT, "NDOF_BUTTON_ALT", 0, "Alt"},
{NDOF_BUTTON_SHIFT, "NDOF_BUTTON_SHIFT", 0, "Shift"},
{NDOF_BUTTON_CTRL, "NDOF_BUTTON_CTRL", 0, "Ctrl"},
# endif
{0, NULL, 0, NULL, NULL},
};
#endif /* RNA_RUNTIME */

View File

@@ -281,35 +281,42 @@ enum {
NDOF_BUTTON_DOMINANT = 0x01a3, /* 419 */
NDOF_BUTTON_PLUS = 0x01a4, /* 420 */
NDOF_BUTTON_MINUS = 0x01a5, /* 421 */
/* General-purpose buttons. */
NDOF_BUTTON_1 = 0x01a6, /* 422 */
NDOF_BUTTON_2 = 0x01a7, /* 423 */
NDOF_BUTTON_3 = 0x01a8, /* 424 */
NDOF_BUTTON_4 = 0x01a9, /* 425 */
NDOF_BUTTON_5 = 0x01aa, /* 426 */
NDOF_BUTTON_6 = 0x01ab, /* 427 */
NDOF_BUTTON_7 = 0x01ac, /* 428 */
NDOF_BUTTON_8 = 0x01ad, /* 429 */
NDOF_BUTTON_9 = 0x01ae, /* 430 */
NDOF_BUTTON_10 = 0x01af, /* 431 */
/* more general-purpose buttons */
NDOF_BUTTON_A = 0x01b0, /* 432 */
NDOF_BUTTON_B = 0x01b1, /* 433 */
NDOF_BUTTON_C = 0x01b2, /* 434 */
/* Store/restore views. */
NDOF_BUTTON_V1 = 0x01b3, /* 435 */
NDOF_BUTTON_V2 = 0x01b4, /* 436 */
NDOF_BUTTON_V3 = 0x01b5, /* 437 */
/* Disabled as GHOST converts these to keyboard events
* which use regular keyboard event handling logic. */
#if 0
/* keyboard emulation */
NDOF_BUTTON_ESC = 0x01a6, /* 422 */
NDOF_BUTTON_ALT = 0x01a7, /* 423 */
NDOF_BUTTON_SHIFT = 0x01a8, /* 424 */
NDOF_BUTTON_CTRL = 0x01a9, /* 425 */
NDOF_BUTTON_ESC = 0x01b6, /* 438 */
NDOF_BUTTON_ENTER = 0x01b7, /* 439 */
NDOF_BUTTON_DELETE = 0x01b8, /* 440 */
NDOF_BUTTON_TAB = 0x01b9, /* 441 */
NDOF_BUTTON_SPACE = 0x01ba, /* 442 */
NDOF_BUTTON_ALT = 0x01bb, /* 443 */
NDOF_BUTTON_SHIFT = 0x01bc, /* 444 */
NDOF_BUTTON_CTRL = 0x01bd, /* 445 */
#endif
/* general-purpose buttons */
NDOF_BUTTON_1 = 0x01aa, /* 426 */
NDOF_BUTTON_2 = 0x01ab, /* 427 */
NDOF_BUTTON_3 = 0x01ac, /* 428 */
NDOF_BUTTON_4 = 0x01ad, /* 429 */
NDOF_BUTTON_5 = 0x01ae, /* 430 */
NDOF_BUTTON_6 = 0x01af, /* 431 */
NDOF_BUTTON_7 = 0x01b0, /* 432 */
NDOF_BUTTON_8 = 0x01b1, /* 433 */
NDOF_BUTTON_9 = 0x01b2, /* 434 */
NDOF_BUTTON_10 = 0x01b3, /* 435 */
/* more general-purpose buttons */
NDOF_BUTTON_A = 0x01b4, /* 436 */
NDOF_BUTTON_B = 0x01b5, /* 437 */
NDOF_BUTTON_C = 0x01b6, /* 438 */
#define _NDOF_MAX NDOF_BUTTON_C
#define _NDOF_BUTTON_MAX NDOF_BUTTON_C
#define _NDOF_MAX NDOF_BUTTON_V3
#define _NDOF_BUTTON_MAX NDOF_BUTTON_V3
/* ********** End of Input devices. ********** */