LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-05-2017, 02:21 PM   #1
watercopter
LQ Newbie
 
Registered: Jan 2017
Posts: 1

Rep: Reputation: Disabled
Joystick abstraction?


You are in your game and set up your input settings for /dev/js0... You unplug the joystick, you plug it back in, and suddenly it's /dev/js1, a whole new beast, and you need to remap eveerything. If you could create a dummy js device before the js are initialized, you can maintain a consistency of js0, js1, and so forth, so that games wont be confused if something is unplugged/replugged, and you dynamically map the dummy to the best guess of what it should be. Is this possible?

Part 2: How would you translate that mapping? My idea here is to create a unifying menu for games that can assist with setting inputs at launch. The idea is to change the translation of the real device to the dummy device when switching games, instead of needing to set configuration within the different games.
 
Old 01-06-2017, 06:54 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,804

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
hm. this happens with cd too, /dev/cd is the virtual device (cd) we use, but actually it is linked to cd0, cd1 or whatever.
probably a similar solution may work in your case too, although you may need some scripting to recognise the device and create the link automatically.
 
  


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
python: archive abstraction library? hydraMax Programming 1 01-15-2012 12:11 AM
abstraction layer for mpg123 fadd and .. linuxsavar Programming 0 10-10-2008 07:35 AM
FrameBuffer abstraction OlafA Programming 1 06-20-2008 11:16 PM
Platfom abstraction layer Lothar Schwab Programming 2 08-05-2007 12:04 AM
Joystick Driver and API under kernel 2.6.12.3 using an USB joystick dispatcher Linux - Newbie 1 08-06-2005 09:43 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:00 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