Totally Lost With Trying To Configure The Joysticks In Xroar

A place to discuss everything Dragon related that doesn't fall into the other categories.
Post Reply
daelectron
Posts: 150
Joined: Fri Jul 27, 2012 12:25 pm

Totally Lost With Trying To Configure The Joysticks In Xroar

Post by daelectron »

I hope someone is going to be able to help with this...

Some games on the Dragon clearly require joysticks. For example, Dragon Invaders is joystick-only.

Xroar has the possibility to use a "virtual joystick" (i.e. the keyboard configured as a joystick).

To use the virtual joystick, you press CTRL-J and then the arrow keys and Alt act as the movement and fire button respectively.

The trouble is with movement. When you press to move left, it is as if you smacked the joystick as far as it would go to the left. I assume the Dragon originally had potietometer (not sure if that's spelled correctly!) joysticks and the harder you pushed, the faster your on-screen game character control responded.

The Xroar manual tells you to configure the virtual joystick via a conf file which, in Windows, would involve something _like_ typing the following:

joy-virtual kjoy0
joy-axis 'keyboard':X=2,254 'keyboard':Y=1.5,190.5

However, the manual is too confusing for me to get to grips with. I wish it gave a few examples! I just want the craft in Dragon Invaders to respond slowly to a press of the left or right keys. Anyone else had this problem?
sixxie
Posts: 1344
Joined: Fri Jul 18, 2008 8:36 am
Location: Hertfordshire
Contact:

Re: Totally Lost With Trying To Configure The Joysticks In X

Post by sixxie »

Ah, what you're trying to achieve is impossible - you can only configure which key pushes in which direction for keyboard-controlled axes. Unfortunately the only "analogue" input without actual joysticks you can use is the mouse, which isn't exaactly great for space invaders...

The syntax is a bit obscure (though better than it used to be!) as it lets you configure things fairly arbitrarily. e.g., you could have the X axis of a joystick controlled by mouse and the Y axis controlled by a physical stick - say a throttle control.

I'll have a think about how one might use they keyboard for analogue input though - probably have to let you define an acceleration value per axis or somesuch.
daelectron
Posts: 150
Joined: Fri Jul 27, 2012 12:25 pm

Re: Totally Lost With Trying To Configure The Joysticks In X

Post by daelectron »

OK, so I have a USB joystick and I plug it into one of the ports. What are the exact commands I need in the Windows config file to be able to use it to control the game.
sixxie
Posts: 1344
Joined: Fri Jul 18, 2008 8:36 am
Location: Hertfordshire
Contact:

Re: Totally Lost With Trying To Configure The Joysticks In X

Post by sixxie »

In theory, it "just works" - the first two axes and first button of the first detected joystick will default to being the "right" joystick (control+shift+j to simple swap right & left without cycling the "virtual joystick" into play, or use the menus).

But if not, you might update the config "joy0". For example, if it was actually joystick index 1 (second physical):

Code: Select all

joy joy0
  joy-axis 0=physical:1,0
  joy-axis 1=physical:1,1
  joy-button 0=physical:1,0
For, er, "forward compatibility", you can actually configure button 1 too, though that's not used for anything right now.

Run XRoar with "-config-print-all" to see all the built-in definitions - might help!
Alastair
Posts: 669
Joined: Fri Jul 18, 2008 11:33 pm

Re: Totally Lost With Trying To Configure The Joysticks In X

Post by Alastair »

sixxie wrote:For, er, "forward compatibility", you can actually configure button 1 too, though that's not used for anything right now.
Turning this around, could the physical 'button 1' of a joystick be configured to represent a key, e.g., the spacebar, instead of representing a hypothetical second button for a Dragon joystick?
Post Reply