Menu

#376 Custom gamepad buttons

GTK3
closed-fixed
compyx
None
new feature
2026-03-10
2020-08-31
Dreamer
No

Option to assign gamepad buttons to program actions like:

  • pause toggle
  • settings
  • quicksave snapshot
  • quickload snapshot
  • swap joystick
  • mute
  • auto-fire
  • hold-fire

Discussion

  • gpz

    gpz - 2020-08-31

    You can do this in the SDL version, btw

     
    • Dreamer

      Dreamer - 2020-08-31

      I'm sorry, but what you mean, where can I find it?

       
  • gpz

    gpz - 2020-08-31

    VICE can be build with GTK3 or SDL UI - the later has that feature (you can map controller buttons to any menu item).
    You can find nightly builds here: https://tinyurl.com/tjzkr5x

     
    • Dreamer

      Dreamer - 2020-08-31

      Thanks, but it looks quite strange, it has no standard menu and options.

       
  • Ziggy

    Ziggy - 2026-02-26

    I just noticed that work is being done to support this now! I tried snapshot build r45992 using the GTK3 version and I was able to map a gamepad button action to "pause-toggle" and saved it using the "Save defaults" button in the x64sc GUI. Then, I quit and reloaded x64sc and confirmed it had my mapping still and it did. But when I pressed the gamepad button I mapped to "pause-toggle" it did not pause the emulator. Is this still a work-in-progress because I saw several places in the GUI that said "To Do"? Thanks for adding this feature!

     
  • gpz

    gpz - 2026-02-26

    It is all very much work in progress indeed

    That said, it "should" work. Mostly :)

    If you want to test, try if it works before you save/quit/restart first

     
  • gpz

    gpz - 2026-02-26

    Tried here - pressing the button to pause works - but pressing it again to unpause does not :) This will need some special case hackery, i guess (the controllers are probably not polled at all in pause mode)

     
  • gpz

    gpz - 2026-02-26
    • assigned_to: compyx
     
  • Ziggy

    Ziggy - 2026-02-26

    Tried again and not working for me. I did as you suggested...mapped gamepad button 4 to mapping type "action" and mapped value to "pause-toggle". Then, before save/quit/restart, I tried it and it did not pause the emulation (i.e. still see the blinking cursor on the C64 screen). I have now tried this on 2 different computers (1 computer has a Logitech F310 gamepad and the other has a Logitech F510 gamepad). I even tried both modes the gamepad supports (XInput vs DirectInput).

     
  • Ziggy

    Ziggy - 2026-02-26

    I figured it out and got it working. On the settings page, I needed to go to the "Joystick" section and select my gamepad for Joystick #1. Then, it worked as you said. I saved with "Save defaults" and quit and restarted x64sc and it worked again. But, as you said it only pauses the emulation...it doesn't resume when you press it again.

     
    • gpz

      gpz - 2026-02-26

      Oh, yes indeed, the controller must be actually used as a joystick input, else it is not polled at all :)

       
  • Ziggy

    Ziggy - 2026-02-26

    Ran some more tests and everything works great! I mapped 2 other button actions "snapshot-load" and "snapshot-save" and they worked as expected. With that working and with the other change that compyx did for me (see #2192 Load and Save Snapshot File Dialog Default Directory), I'm now able to press a gamepad button to load/save a snapshot and have my configured snapshot dir show up as the default dir! These are some really nice updates! Now, if we could just get that pause-toggle to resume after being paused!

     
  • gpz

    gpz - 2026-03-09

    try r46016 - unpause should work now

     
  • gpz

    gpz - 2026-03-09
    • status: open --> closed-fixed
     
  • Ziggy

    Ziggy - 2026-03-10

    Ran some tests with gamepad buttons mapped to pause-toggle, snapshot-load, and snapshot-save and everything worked great! pause-toggle works as expected now...first press pauses game and next press resumes game. Thanks for fixing this...

     

Log in to post a comment.

MongoDB Logo MongoDB