Question: OpenMSX - Autofire

By Jeroen Kwakkel

Supporter (1)

Jeroen Kwakkel's picture

16-02-2017, 21:02

Is it posible to bind a joystick button with 'repeating' a button press?
I have used joy2key for auto repeating keys strokes, but openmsx won't handle that well.

please help!

Login or register to post comments

By luppie

Paladin (869)

luppie's picture

16-02-2017, 21:31

Check the OpenMSX Manual : http://openmsx.org/manual/commands.html#bind

Look for the -repeat command

By diederick76

Expert (114)

diederick76's picture

16-02-2018, 16:35

I realize this thread is already a year old, but it is the first hit at DuckDuckGo.

Anyway. The openMSX manual isn't clear on how to use -repeat to autofire a joystick button. I understand I have to use bind with an event and a command. So, something like

bind "joy1 button1 down" type "hello"

will output hello to my screen. But what would be the command to fire button 1 on joystick 1? I tried typing a space, but that results in "warning: Error executing hot key command: Syntax error" Question

By Manuel

Ascended (19676)

Manuel's picture

16-02-2018, 23:54

Do you want to control the joystick fire button or do you want to let it press the space bar?
For the latter, use the keymatrixdown/up command.

For the former, I'm not sure. Is this possible, Wouter?

By baarreth

Supporter (4)

baarreth's picture

16-01-2022, 03:51

Sorry for posting on this old thread, but as pointed out, the internet search engines show this one when you look for "openmsx autofire".

I tried to create an auto-fire bind using -repeat, keymatrixdown/up, and after, but my best configurations worked for a few seconds and stopped working (tbh, it behave differently in different games, but my reference was CAPCOM's 1942).

So far so good, "not working" makes sense here, since we need to set a frequency for the keystrokes in an auto-fire, and for example, we don't know when a sequence of keymatrixdown/up in a bind with -repeat will be executed.

Through this, my poor man's choice was to create a burst-fire with type_via_keyboard.


Suppose you want to create an burst-fire for button A (which is mapped as the keyboard's SPACE), and you want to configure it on your joystick's button 1. Suppose you want 15 keystrokes per second, and you want the burst to last for just a second. You can achieve that through the following bind:

bind "joy1 button1 down" "type_via_keyboard -release -freq 15 \"               \""

Which in setting.xml will be stored as:

<bind key="joy1 button1 down">type_via_keyboard -release -freq 15 "               "</bind>

By Manuel

Ascended (19676)

Manuel's picture

16-01-2022, 12:07

Note that some MSX machines have a built-in autofire ("Ren-Sha Turbo"). This is emulated.