Skip to content

Commit

Permalink
add jcdriver (userspace linux uinput driver) to Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
riking committed Jun 16, 2017
1 parent 206c374 commit 74c84ea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ SRCS = $(addprefix src/, $(SRCFILES))
HEADS = $(addprefix src/, $(HEADFILES))
OBJS = $(SRCS:.c=.o)

all: jcmapper
all: jcmapper jcdriver

format: $(SRCS) $(HEADS) switchconnect/main.c
clang-format -style=file -i $^
Expand All @@ -28,6 +28,12 @@ clean:
rm -f devinput/hidapi_demo.o
rm -f switchconnect/main.o

GOBIN ?= $(GOPATH)/bin

jcdriver: prog4
go install -v ./prog4/jcdriver
cp $(GOBIN)/jcdriver .

jcmapper: $(OBJS)
gcc -o $@ $^ $(LDFLAGS)

Expand Down
9 changes: 5 additions & 4 deletions prog4/output/keymap_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type ControllerMapping struct {
// https://w3c.github.io/gamepad/#remapping
// JoyCons are negative left/down, positive up/right (docked orientation)
// System expects negative left/up, positive right/down
// screencheat expects positive up

var MappingL = ControllerMapping{
Keys: []commonKeyMap{
Expand All @@ -40,7 +41,7 @@ var MappingL = ControllerMapping{
},
Axes: []commonStickMap{
{jcpc.Axis_L_Vertical, false, "MainStickHoriz"},
{jcpc.Axis_L_Horiz, true, "MainStickVertical"},
{jcpc.Axis_L_Horiz, false, "MainStickVertical"},
},
}

Expand All @@ -62,7 +63,7 @@ var MappingR = ControllerMapping{
},
Axes: []commonStickMap{
{jcpc.Axis_R_Vertical, true, "MainStickHoriz"},
{jcpc.Axis_R_Horiz, false, "MainStickVertical"},
{jcpc.Axis_R_Horiz, true, "MainStickVertical"},
},
}

Expand Down Expand Up @@ -98,8 +99,8 @@ var MappingDual = ControllerMapping{
},
Axes: []commonStickMap{
{jcpc.Axis_L_Horiz, false, "MainStickHoriz"},
{jcpc.Axis_L_Vertical, true, "MainStickVertical"},
{jcpc.Axis_L_Vertical, false, "MainStickVertical"},
{jcpc.Axis_R_Horiz, false, "SecondStickHoriz"},
{jcpc.Axis_R_Vertical, true, "SecondStickVertical"},
{jcpc.Axis_R_Vertical, false, "SecondStickVertical"},
},
}

0 comments on commit 74c84ea

Please sign in to comment.