LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-28-2019, 04:45 PM   #1
reclined
LQ Newbie
 
Registered: Mar 2019
Distribution: Ubuntu
Posts: 2

Rep: Reputation: Disabled
How can I map the switches of a joystick on Ubuntu linux?


Hello,

I am wanting to try mapping the switches on a CH Throttle Pro joystick to act as keyboard keys.

My OS of choice is Ubuntu linux

-why-
I am trying to find a typing solution to use when lying flat on my back

speech isn`t an option, neither is maintaining a raised hand position so speech to text and almost all keyboards fail to qualify.

when upright I need to see where I am pressing to accurately type, when lying on my back this isn`t feasible.

-so-
The textured well separated keys of a throttle/flightstick seem well suited to typing without look at where fingers strike while being fully reclined.


* so far I have used dmesg to see that the throttle is recognised as being plugged in
$ dmesg|grep THROTTLE
[ 6413.129502] usb 1-8: Product: CH PRO THROTTLE USB
[ 6413.156721] input: CH PRODUCTS CH PRO THROTTLE USB as /devices/pci0000:00/0000:00:01.3/0000:01:00.0/usb1/1-8/1-8:1.0/0003:068E:00F1.0002/input/input17
[ 6413.157019] hid-generic 0003:068E:00F1.0002: input,hidraw1: USB HID v1.00 Joystick [CH PRODUCTS CH PRO THROTTLE USB ] on usb-0000:01:00.0-8/input0
[19392.979246] usb 5-3: Product: CH PRO THROTTLE USB
[19392.990885] input: CH PRODUCTS CH PRO THROTTLE USB as /devices/pci0000:00/0000:00:07.1/0000:08:00.3/usb5/5-3/5-3:1.0/0003:068E:00F1.0003/input/input18
[19392.991082] hid-generic 0003:068E:00F1.0003: input,hidraw1: USB HID v1.00 Joystick [CH PRODUCTS CH PRO THROTTLE USB ] on usb-0000:08:00.3-3/input0


* and tried xev to check for response to switch presses = no responses to any throttle input, my keyboard and mouse show up fine


I don`t know where to start with recognising joystick input nor how to remap the switch responses to deliver keystrokes.

I would for testing also have a usb keyboard and usb mouse connected which I don`t want to misplace but rather have all three input devices functioning, the keyboard and throttle recognised for keystrokes.

any advice and guides appreciated

Douglas
 
Old 03-28-2019, 05:53 PM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,793

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
If you're using a recent Ubuntu version, then libinput should be handling input events.

For Xorg-related drivers, the input drivers in use can be determined with...
Code:
grep "Using input" /var/log/Xorg.0.log
Assuming libinput, the following reference may be useful here...
https://wiki.archlinux.org/index.php...ton_re-mapping
 
Old 03-29-2019, 04:08 PM   #3
reclined
LQ Newbie
 
Registered: Mar 2019
Distribution: Ubuntu
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thankyou for the reply

my current OS is an up to date Ubuntu 18.04.2 LTS


-libinput wasn`t present-
Quote:
$ libinput list-devices

Command 'libinput' not found, but can be installed with:

sudo apt install libinput-tools
*installed libinput, then rebooted

`xinput list` and `libinput list-devices`

Quote:
$ sudo libinput list-devices

Device: Power Button
Kernel: /dev/input/event1
Group: 1
Seat: seat0, default
Capabilities: keyboard
Tap-to-click: n/a
Tap-and-drag: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: n/a
Scroll methods: none
Click methods: none
Disable-w-typing: n/a
Accel profiles: n/a
Rotation: n/a

Device: Power Button
Kernel: /dev/input/event0
Group: 2
Seat: seat0, default
Capabilities: keyboard
Tap-to-click: n/a
Tap-and-drag: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: n/a
Scroll methods: none
Click methods: none
Disable-w-typing: n/a
Accel profiles: n/a
Rotation: n/a

Device: HDA ATI HDMI HDMI/DP,pcm=11
Kernel: /dev/input/event10
Group: 3
Seat: seat0, default
Capabilities:
Tap-to-click: n/a
Tap-and-drag: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: n/a
Scroll methods: none
Click methods: none
Disable-w-typing: n/a
Accel profiles: n/a
Rotation: n/a

Device: HDA ATI HDMI HDMI/DP,pcm=3
Kernel: /dev/input/event5
Group: 3
Seat: seat0, default
Capabilities:
Tap-to-click: n/a
Tap-and-drag: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: n/a
Scroll methods: none
Click methods: none
Disable-w-typing: n/a
Accel profiles: n/a
Rotation: n/a

Device: HDA ATI HDMI HDMI/DP,pcm=7
Kernel: /dev/input/event6
Group: 3
Seat: seat0, default
Capabilities:
Tap-to-click: n/a
Tap-and-drag: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: n/a
Scroll methods: none
Click methods: none
Disable-w-typing: n/a
Accel profiles: n/a
Rotation: n/a

Device: HDA ATI HDMI HDMI/DP,pcm=8
Kernel: /dev/input/event7
Group: 3
Seat: seat0, default
Capabilities:
Tap-to-click: n/a
Tap-and-drag: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: n/a
Scroll methods: none
Click methods: none
Disable-w-typing: n/a
Accel profiles: n/a
Rotation: n/a

Device: HDA ATI HDMI HDMI/DP,pcm=9
Kernel: /dev/input/event8
Group: 3
Seat: seat0, default
Capabilities:
Tap-to-click: n/a
Tap-and-drag: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: n/a
Scroll methods: none
Click methods: none
Disable-w-typing: n/a
Accel profiles: n/a
Rotation: n/a

Device: HDA ATI HDMI HDMI/DP,pcm=10
Kernel: /dev/input/event9
Group: 3
Seat: seat0, default
Capabilities:
Tap-to-click: n/a
Tap-and-drag: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: n/a
Scroll methods: none
Click methods: none
Disable-w-typing: n/a
Accel profiles: n/a
Rotation: n/a

Device: HID-compliant Mouse HID-compliant Mouse
Kernel: /dev/input/event4
Group: 4
Seat: seat0, default
Capabilities: pointer
Tap-to-click: n/a
Tap-and-drag: n/a
Tap drag lock: n/a
Left-handed: disabled
Nat.scrolling: disabled
Middle emulation: disabled
Calibration: n/a
Scroll methods: button
Click methods: none
Disable-w-typing: n/a
Accel profiles: flat *adaptive
Rotation: n/a

Device: HD-Audio Generic Front Mic
Kernel: /dev/input/event11
Group: 3
Seat: seat0, default
Capabilities:
Tap-to-click: n/a
Tap-and-drag: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: n/a
Scroll methods: none
Click methods: none
Disable-w-typing: n/a
Accel profiles: n/a
Rotation: n/a

Device: HD-Audio Generic Rear Mic
Kernel: /dev/input/event12
Group: 3
Seat: seat0, default
Capabilities:
Tap-to-click: n/a
Tap-and-drag: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: n/a
Scroll methods: none
Click methods: none
Disable-w-typing: n/a
Accel profiles: n/a
Rotation: n/a

Device: HD-Audio Generic Line
Kernel: /dev/input/event13
Group: 3
Seat: seat0, default
Capabilities:
Tap-to-click: n/a
Tap-and-drag: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: n/a
Scroll methods: none
Click methods: none
Disable-w-typing: n/a
Accel profiles: n/a
Rotation: n/a

Device: HD-Audio Generic Line Out Front
Kernel: /dev/input/event14
Group: 3
Seat: seat0, default
Capabilities:
Tap-to-click: n/a
Tap-and-drag: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: n/a
Scroll methods: none
Click methods: none
Disable-w-typing: n/a
Accel profiles: n/a
Rotation: n/a

Device: HD-Audio Generic Line Out Surround
Kernel: /dev/input/event15
Group: 3
Seat: seat0, default
Capabilities:
Tap-to-click: n/a
Tap-and-drag: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: n/a
Scroll methods: none
Click methods: none
Disable-w-typing: n/a
Accel profiles: n/a
Rotation: n/a

Device: HD-Audio Generic Line Out CLFE
Kernel: /dev/input/event16
Group: 3
Seat: seat0, default
Capabilities:
Tap-to-click: n/a
Tap-and-drag: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: n/a
Scroll methods: none
Click methods: none
Disable-w-typing: n/a
Accel profiles: n/a
Rotation: n/a

Device: HD-Audio Generic Front Headphone
Kernel: /dev/input/event17
Group: 3
Seat: seat0, default
Capabilities:
Tap-to-click: n/a
Tap-and-drag: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: n/a
Scroll methods: none
Click methods: none
Disable-w-typing: n/a
Accel profiles: n/a
Rotation: n/a

Device: AT Translated Set 2 keyboard
Kernel: /dev/input/event2
Group: 5
Seat: seat0, default
Capabilities: keyboard
Tap-to-click: n/a
Tap-and-drag: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: n/a
Scroll methods: none
Click methods: none
Disable-w-typing: n/a
Accel profiles: n/a
Rotation: n/a


*xinput list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ HID-compliant Mouse HID-compliant Mouse id=8 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Power Button id=7 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=9 [slave keyboard (3)]
showed my mouse and keyboard but no sign of the throttle

the dmesg shows them all fine, keyboard mounted as input/input2, the throttle as input/input3

Quote:
$ grep CH dmesg-March29th2019.txt
[ 1.452724] usb 5-3: Product: CH PRO THROTTLE USB
[ 1.452725] usb 5-3: Manufacturer: CH PRODUCTS
[ 1.821831] input: CH PRODUCTS CH PRO THROTTLE USB as /devices/pci0000:00/0000:00:07.1/0000:08:00.3/usb5/5-3/5-3:1.0/0003:068E:00F1.0001/input/input3
[ 1.821880] hid-generic 0003:068E:00F1.0001: input,hidraw0: USB HID v1.00 Joystick [CH PRODUCTS CH PRO THROTTLE USB ] on usb-0000:08:00.3-3/input0
[ 2629.604518] IPv6: ADDRCONF(NETDEV_CHANGE): enp4s0: link becomes ready
MyMachine:~$ grep keyboard dmesg-March29th2019.txt
[ 0.939028] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input2
MyMachine:~$ grep mouse dmesg-March29th2019.txt
[ 0.918638] mousedev: PS/2 mouse device common for all mice
and xev shows no response to any switches on the throttle while responding freely to my keyboard and mouse
(all three devices are connected via usb direct to the rear panel of the motherboard, each of them with at least one led powered up).

any suggestions?
 
Old 03-30-2019, 05:24 PM   #4
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,793

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
The following commands will list devices present
Code:
xinput list
or
Code:
libinput list-devices
From that you can get the device name and get current button mapping (if applicable)...
Code:
xinput get-button-map <device_name>
then remap using
Code:
xinput set-button-map <device_name> .....
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Joystick recognised - but not as a joystick! Captain_Bodge Linux - Hardware 4 03-11-2008 03:13 PM
Joystick Driver and API under kernel 2.6.12.3 using an USB joystick dispatcher Linux - Newbie 1 08-06-2005 09:43 AM
SYSERR(root): hash map "generics": missing map file /etc/mail/genericstable.db? singying304 Linux - Networking 4 02-28-2005 06:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration