Custom Hotkeys
-
Hope someone can help with what I'm trying to do here. I'm not going to lie I'm a bit of a novice here so please bare with me.
So basically, as nerdy as it sounds, I'm making a life-size Gameboy outfit that I want to be working. I'm using a makey makey as my controller and I believe that it's recognised as a keyboard by retropie. What I want to do is to make it so I can press a button to load a specific game. I've looked around and seen you can edit the config file, would this be a way of doing it? I've also seen some people use scripts to get a specific action to happen, could this be another option?
Any help would be much appreciated!
-
-
Raspbian includes the
triggerhappy
program that can do what you need, to trigger actions for certain key presses - https://github.com/wertarbyte/triggerhappy - and it's included and installed by default on a RetroPie image (well, Raspbian adds it by default). -
Thanks! After having a look that does look like it'd be able to do what I need it to! Because I am really a novice at this though it's causing me a bit of a headache. I've put a .conf file in:
/etc/triggerhappy/triggers.d that contains:"KEY_G 1 /home/pi/RetroPie/roms/gb/Pokemon Red.gb"
And that's not doing anything. But I'm also not sure if I need to preface the file directory in the config file with a load command or something.
Thanks for the help again!
-
@flajubam That's not the way to launch a ROM. The command to launch a ROM is more complex (e.g. something like https://retropie.org.uk/docs/FAQ/#how-would-i-start-from-command-line-say-the-snes-emulator-by-itself).
What you can do is launch the ROM, then exit. Check the/dev/shm/runcommand.info
file (last line) and you'll see the full command line used to launch the ROM, which you can use it in the trigger definition. -
@mitu Thanks again, that seems to be working. Although it's quite odd, when I load the game manually through the menu. The game has the classic green tinge, when I load it through this it goes to a basic white. Do you know any reason it'd be doing this?
Also if I load it via the hotkey once I've already loaded it once, the pi just crashes. -
@flajubam How did you install RetroPie ?
About the green vs. white tinge - that might be a shader not being applied; the crash thing might be normal if you start to run a 2nd instance again once it's started, so you should wrap the command in a shell script that checks if RetroArch is started and only starts the emulator if it's not currently running. -
@mitu I installed it ages ago so I can't really remember, probably however the first result on google says to haha. How would I go about fixing the shader issue? Could I somehow tell retroarch to apply the shader when loading like this? With the shell script, would that not stop it working if I was in another rom in the same emulator? And do you know any places I could look to find out how to write a script like that?
Sorry for all the questions!
-
@flajubam said in Custom Hotkeys:
How would I go about fixing the shader issue? Could I somehow tell retroarch to apply the shader when loading like this?
One you load the game, use the RGUI (
Select + X
) then choose a shader to apply - https://retropie.org.uk/docs/Shaders-and-Smoothing/#shaders. You can choose each shader in turn and find the one that suits you. You can then use the Configuration editor to have the shader load each time - either for your emulator or globally - or, from the RGUI, choose theSave Core override
to have the shader configuration saved for that emulator.As for the 2nd question, scripting is a large subject - the usual reference is the Advance Bash Scripting Guide.
-
@mitu Thanks for the links, I'll have a look and try to figure it out. I don't think it's shaders though as when I go into that menu for either it doesn't say any shaders are set and when I enable one I get serious lag issues. The only difference I could see was the colour palette was different. But when I change that to be the same I only get a very slight green tinge. So I'm a bit stuck on what's causing that 😅
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.