Using a Save and Load Hotkey

Home Forums RetroPie Project Controller Configuration in RetroPie Using a Save and Load Hotkey

This topic contains 7 replies, has 2 voices, and was last updated by Profile photo of Floob Floob 1 year, 5 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #113446
    Profile photo of josh
    josh
    Participant

    Using a Save and Load Hotkey
    I have looked up many sources but simply cannot find the answer to my question.
    How can I set up a Save and Load Hotkey using Keyboard Input?
    I know how I might be able to use this with a controller but don’t know how to do it with a keyboard. I am making a product much like the PiGRRL and I am using Adafruit’s Retro Game program to convert the GPIO signals to Keyboard Input. This all works fine for games but I simply can’t get it to work with keyboard hotkeys.
    I tried changing these lines:
    # Saves state.
    #input_save_state = x
    # Loads state.
    #input_load_state = z
    to
    # Saves state.
    input_save_state = x + rshift
    # Loads state.
    input_load_state = z + rshift
    This did not seem to work however. I would be very grateful for a response and will mention the name of who replied in an upcoming blog on how I made my Super Pi Boy…

    Thanks again,
    Josh

    #113453
    Profile photo of Floob
    Floob
    Member

    The lines you edited above can only have a single key.

    The hotkey enable would be here:
    input_enable_hotkey =

    So you hold your enable hotkey down then tap the hotkey

    input_save_state = x
    input_enable_hotkey = rshift

    would mean holding Right Shift and tapping x would save the game, assuming no other hotkeys or functions are mapped to x.

    RetroPie help guides --> https://goo.gl/Yfy8kj
    Please read this before asking for help --> http://goo.gl/eLErnl

    #113476
    Profile photo of josh
    josh
    Participant

    Hi Floob,
    Thanks for the quick reply! I have tried this for save but it appears that just RShift alone (Select Button) saves the game and when I used the same code to load the game (changing x to z) nothing happens. No hotkeys are mapped to X however, because we are using the Gameboy buttons, it is not possible to create a dedicated save and load button and all of the buttons are used. Start + Select work fine to exit a game. However, Select (RShift) and A (Z) together don’t work to load the game at all.
    Here’s the code:
    # Saves state.
    input_save_state = x
    input_enable_hotkey = rshift
    # Loads state
    input_load_state = z
    input_enable_hotkey = rshift

    Thanks again,
    Josh

    Attachments:
    #113482
    Profile photo of Floob
    Floob
    Member

    This line should only exist once in the whole file
    input_enable_hotkey = rshift

    Can you post your retroarch.cfg to pastebin.com and I’ll check it.

    If possible, can you tell me what keyboard keys each of your buttons map to?

    RetroPie help guides --> https://goo.gl/Yfy8kj
    Please read this before asking for help --> http://goo.gl/eLErnl

    #113488
    Profile photo of josh
    josh
    Participant

    Here is my retroarch.cfg file:
    http://pastebin.com/zBByPybD
    My input is as follows:
    Up, Down, Left and Right = The Arrow Keys
    Start = R
    Select = Q
    A = Z
    B = X

    If it matters, I am using the default NES emulator, I don’t know if that would change anything?

    Thanks again,
    Josh
    PS: It had only just occurred to me that I said rshift was select, that was in the Retroarch Config file, not what the actual inputs were through Emulationstation…

    #113494
    Profile photo of josh
    josh
    Participant

    Me and my Dad have had another look at the config file.
    Firstly, we were originally editing /opt/retropie/emulators/retroarch/retroarch.cfg however it seems like we were editing the wrong directory…
    This is the correct directory:
    /opt/retropie/configs/all/retroarch.cfg
    These are the lines of code that we used:
    # Saves state.
    input_enable_hotkey = q
    input_save_state = x
    # Loads state.
    input_load_state = z

    My Super Pi Boy project is now complete!
    Also, make sure that you uncomment the input_load_state = z line.

    Thank you so very much Floob for helping me with this issue. I hope that this post will help everyone who needs to overcome this problem.

    Thanks again,
    Josh

    #113495
    Profile photo of Floob
    Floob
    Member

    This
    input_enable_hotkey = q

    should read

    input_enable_hotkey = rshift

    on the assumption your arcade stick sends a right shift single on the button you want to use as the enable hotkey.

    Then pressing x on your arcade stick (The A button?) should save the game.

    The hotkey enable for your usb PS3 controller will be held in the controller config file, so that parts separate. /opt/retropie/configs/all/retroarch-joypads/

    Here is a (slightly outdated) video on hotkeys

    RetroPie help guides --> https://goo.gl/Yfy8kj
    Please read this before asking for help --> http://goo.gl/eLErnl

    #113497
    Profile photo of Floob
    Floob
    Member

    Great, glad its sorted. Yes, the correct file is /opt/retropie/configs/all/retroarch.cfg unless you need to edit controller files as well.

    RetroPie help guides --> https://goo.gl/Yfy8kj
    Please read this before asking for help --> http://goo.gl/eLErnl

Viewing 8 posts - 1 through 8 (of 8 total)

Forums are currently read only - please visit the new RetroPie forums at https://retropie.org.uk/forums/

Skip to toolbar