Start work adding rinputer2

This commit is contained in:
mason 2023-11-23 16:06:00 +00:00
parent c576a6a27a
commit 5fb45d5fb0
No known key found for this signature in database
GPG key ID: 84D9278A11FA112B
7 changed files with 142 additions and 1 deletions

View file

@ -0,0 +1,19 @@
PKG_NAME="jelos-gamepad"
PKG_VERSION="b1fc0fb69047011d99b54029be500280d33a8027"
PKG_ARCH="aarch64"
PKG_LICENSE="GPLv3"
PKG_SITE="https://github.com/R-ARM/rinputer2"
PKG_URL="$PKG_SITE.git"
PKG_DEPENDS_TARGET="toolchain"
PKG_TOOLCHAIN="make"
GET_HANDLER_SUPPORT="git"
makeinstall_target() {
mkdir -p $INSTALL/usr/bin
cp rinputer2 ${INSTALL}/usr/bin/jelos_gamepad
chmod 0755 ${INSTALL}/usr/bin/jelos_gamepad
}
post_install() {
enable_service jelos_gamepad.service
}

View file

@ -0,0 +1,56 @@
diff -rupN rinputer2.orig/main.c rinputer2/main.c
--- rinputer2.orig/main.c 2023-11-23 04:47:16.344733862 +0000
+++ rinputer2/main.c 2023-11-23 15:00:20.535535759 +0000
@@ -240,7 +240,7 @@ int rescan_devices(struct rinputer_devic
continue;
// let's not make a loop
- if(strncmp("Rinputer", name, 8) == 0)
+ if(strncmp("JELOS Gamepad", name, 8) == 0)
continue;
// ignore steam-created controllers
// they have this name, with a digit at the end
@@ -316,10 +316,10 @@ int main(void)
ioctl(outfd, UI_SET_EVBIT, EV_KEY);
- //ioctl(outfd, UI_SET_KEYBIT, BTN_DPAD_UP); // dpad up
- //ioctl(outfd, UI_SET_KEYBIT, BTN_DPAD_DOWN); // dpad down
- //ioctl(outfd, UI_SET_KEYBIT, BTN_DPAD_LEFT); // dpad left
- //ioctl(outfd, UI_SET_KEYBIT, BTN_DPAD_RIGHT); // dpad right
+ ioctl(outfd, UI_SET_KEYBIT, BTN_DPAD_UP); // dpad up
+ ioctl(outfd, UI_SET_KEYBIT, BTN_DPAD_DOWN); // dpad down
+ ioctl(outfd, UI_SET_KEYBIT, BTN_DPAD_LEFT); // dpad left
+ ioctl(outfd, UI_SET_KEYBIT, BTN_DPAD_RIGHT); // dpad right
ioctl(outfd, UI_SET_KEYBIT, BTN_NORTH); // x
ioctl(outfd, UI_SET_KEYBIT, BTN_SOUTH); // b
@@ -332,6 +332,9 @@ int main(void)
ioctl(outfd, UI_SET_KEYBIT, BTN_TR2); // L2
ioctl(outfd, UI_SET_KEYBIT, BTN_TL2); // R2
+ ioctl(outfd, UI_SET_KEYBIT, BTN_THUMBL); // L3
+ ioctl(outfd, UI_SET_KEYBIT, BTN_THUMBR); // R3
+
ioctl(outfd, UI_SET_KEYBIT, BTN_SELECT);
ioctl(outfd, UI_SET_KEYBIT, BTN_START);
@@ -350,15 +353,15 @@ int main(void)
setup_abs(outfd, ABS_RZ);
// dpad
- setup_abs(outfd, ABS_HAT0X);
- setup_abs(outfd, ABS_HAT0Y);
+ //setup_abs(outfd, ABS_HAT0X);
+ //setup_abs(outfd, ABS_HAT0Y);
// maybe we should pretend to be xbox gamepad?
memset(&usetup, 0, sizeof(usetup));
usetup.id.bustype = BUS_USB;
usetup.id.vendor = 0x1234;
usetup.id.product = 0x5678;
- strcpy(usetup.name, "Rinputer");
+ strcpy(usetup.name, "JELOS Gamepad");
ioctl(outfd, UI_DEV_SETUP, &usetup);
ioctl(outfd, UI_DEV_CREATE);

View file

@ -0,0 +1,9 @@
[Unit]
Description=Ragnarok Input Daemon
[Service]
Type=simple
ExecStart=/usr/bin/jelos_gamepad
[Install]
WantedBy=multi-user.target

View file

@ -6,3 +6,4 @@
1900c3ea010000000100000001010000,odroidgo3_joypad,platform:Linux,x:b2,a:b1,b:b0,y:b3,back:b12,start:b13,dpleft:b10,dpdown:b9,dpright:b11,dpup:b8,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b15,rightstick:b16,leftx:a0,lefty:a1,rightx:a2,righty:a3,
19009b4d4b4800000111000000020000,retrogame_joypad,platform:Linux,x:b2,a:b1,b:b0,y:b3,back:b8,start:b9,dpleft:b15,dpdown:b14,dpright:b16,dpup:b13,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b11,rightstick:b12,leftx:a0,lefty:a1,rightx:a2,righty:a3,
19009b4d4b4800000111000000010000,retrogame_joypad,platform:Linux,x:b2,a:b1,b:b0,y:b3,back:b8,start:b9,dpleft:b15,dpdown:b14,dpright:b16,dpup:b13,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b11,rightstick:b12,leftx:a0,lefty:a1,rightx:a2,righty:a3,
0300fcb7341200007856000000000000,JELOS Gamepad,platform:Linux,x:b2,a:b1,b:b0,y:b3,back:b8,start:b9,dpleft:b15,dpdown:b14,dpright:b16,dpup:b13,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b11,rightstick:b12,leftx:a0,lefty:a1,rightx:a3,righty:a4,

View file

@ -0,0 +1,29 @@
input_driver = "udev"
input_device = "JELOS Gamepad"
input_vendor_id = "1234"
input_product_id = "5648"
input_b_btn = "0"
input_y_btn = "3"
input_select_btn = "8"
input_start_btn = "9"
input_up_btn = "13"
input_down_btn = "14"
input_left_btn = "15"
input_right_btn = "16"
input_a_btn = "1"
input_x_btn = "2"
input_l_btn = "4"
input_r_btn = "5"
input_l2_btn = "6"
input_r2_btn = "7"
input_l3_btn = "11"
input_r3_btn = "12"
input_l_x_plus_axis = "+0"
input_l_x_minus_axis = "-0"
input_l_y_plus_axis = "+1"
input_l_y_minus_axis = "-1"
input_r_x_plus_axis = "+3"
input_r_x_minus_axis = "-3"
input_r_y_plus_axis = "+4"
input_r_y_minus_axis = "-4"
input_gun_trigger_mbtn = "1"

View file

@ -1267,4 +1267,31 @@
<input name="x" type="button" id="2" value="1" />
<input name="y" type="button" id="3" value="1" />
</inputConfig>
<inputConfig type="joystick" deviceName="JELOS Gamepad" deviceGUID="0300fcb7341200007856000000000000">
<input name="a" type="button" id="1" value="1" />
<input name="b" type="button" id="0" value="1" />
<input name="down" type="button" id="14" value="1" />
<input name="hotkeyenable" type="button" id="8" value="1" />
<input name="left" type="button" id="15" value="1" />
<input name="leftanalogdown" type="axis" id="1" value="-1" />
<input name="leftanalogleft" type="axis" id="0" value="-1" />
<input name="leftanalogright" type="axis" id="0" value="1" />
<input name="leftanalogup" type="axis" id="1" value="1" />
<input name="leftshoulder" type="button" id="4" value="1" />
<input name="leftthumb" type="button" id="11" value="1" />
<input name="lefttrigger" type="button" id="6" value="1" />
<input name="right" type="button" id="16" value="1" />
<input name="rightanalogdown" type="axis" id="4" value="-1" />
<input name="rightanalogleft" type="axis" id="3" value="-1" />
<input name="rightanalogright" type="axis" id="3" value="1" />
<input name="rightanalogup" type="axis" id="4" value="1" />
<input name="rightshoulder" type="button" id="5" value="1" />
<input name="rightthumb" type="button" id="12" value="1" />
<input name="righttrigger" type="button" id="7" value="1" />
<input name="select" type="button" id="8" value="1" />
<input name="start" type="button" id="9" value="1" />
<input name="up" type="button" id="13" value="1" />
<input name="x" type="button" id="2" value="1" />
<input name="y" type="button" id="3" value="1" />
</inputConfig>
</inputList>

View file

@ -89,7 +89,7 @@
# for a list of additional drivers see packages/linux-drivers
# Space separated list is supported,
# e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2"
ADDITIONAL_DRIVERS="RTL8821AU RTL8821CU RTL88x2BU"
ADDITIONAL_DRIVERS="RTL8821AU RTL8821CU RTL88x2BU jelos-gamepad"
# build and install driver addons (yes / no)
DRIVER_ADDONS_SUPPORT="no"