Skip to content

Commit

Permalink
Merge pull request #818 from bjornbytes/mx-ink
Browse files Browse the repository at this point in the history
MX Ink Input
  • Loading branch information
bjornbytes authored Dec 9, 2024
2 parents 4186b48 + e8774b3 commit 7f60f26
Show file tree
Hide file tree
Showing 3 changed files with 256 additions and 158 deletions.
7 changes: 5 additions & 2 deletions src/api/l_headset.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ StringEntry lovrDevice[] = {
[DEVICE_FOOT_RIGHT] = ENTRY("foot/right"),
[DEVICE_CAMERA] = ENTRY("camera"),
[DEVICE_KEYBOARD] = ENTRY("keyboard"),
[DEVICE_STYLUS] = ENTRY("stylus"),
[DEVICE_EYE_LEFT] = ENTRY("eye/left"),
[DEVICE_EYE_RIGHT] = ENTRY("eye/right"),
[DEVICE_EYE_GAZE] = ENTRY("eye/gaze"),
Expand All @@ -70,7 +71,7 @@ StringEntry lovrDeviceButton[] = {
[BUTTON_B] = ENTRY("b"),
[BUTTON_X] = ENTRY("x"),
[BUTTON_Y] = ENTRY("y"),
[BUTTON_PROXIMITY] = ENTRY("proximity"),
[BUTTON_NIB] = ENTRY("nib"),
{ 0 }
};

Expand All @@ -79,6 +80,7 @@ StringEntry lovrDeviceAxis[] = {
[AXIS_THUMBSTICK] = ENTRY("thumbstick"),
[AXIS_TOUCHPAD] = ENTRY("touchpad"),
[AXIS_GRIP] = ENTRY("grip"),
[AXIS_NIB] = ENTRY("nib"),
{ 0 }
};

Expand Down Expand Up @@ -512,7 +514,8 @@ static const int axisCounts[MAX_AXES] = {
[AXIS_TRIGGER] = 1,
[AXIS_THUMBSTICK] = 2,
[AXIS_TOUCHPAD] = 2,
[AXIS_GRIP] = 1
[AXIS_GRIP] = 1,
[AXIS_NIB] = 1
};

static int l_lovrHeadsetGetAxis(lua_State* L) {
Expand Down
4 changes: 3 additions & 1 deletion src/modules/headset/headset.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ typedef enum {
DEVICE_FOOT_RIGHT,
DEVICE_CAMERA,
DEVICE_KEYBOARD,
DEVICE_STYLUS,
DEVICE_EYE_LEFT,
DEVICE_EYE_RIGHT,
DEVICE_EYE_GAZE,
Expand All @@ -111,7 +112,7 @@ typedef enum {
BUTTON_B,
BUTTON_X,
BUTTON_Y,
BUTTON_PROXIMITY,
BUTTON_NIB,
MAX_BUTTONS
} DeviceButton;

Expand All @@ -120,6 +121,7 @@ typedef enum {
AXIS_THUMBSTICK,
AXIS_TOUCHPAD,
AXIS_GRIP,
AXIS_NIB,
MAX_AXES
} DeviceAxis;

Expand Down
Loading

0 comments on commit 7f60f26

Please sign in to comment.