It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
Hi everyone!

I'm a MacOS / OSX user. I've noted across game forums a number of complaints about function (F1 - F12) hot keys conflicting with the system, rendering games frustrating or impossible to use. I'm a programmer and, with a little digging, I was able to come up with something that I think most everyone could use or customize to help solve the problem. Thought I'd do a writeup here.

First, some outdated or otherwise tough information:

- Some people have mentioned using DOSBox Mapper to fix their problems. It looks like that's outdated, and is otherwise disabled / impossible to do with the Galaxy client.
- Others have noted Karabiner, a keyboard customizer for OS X. I gave this a shot and wound up creating a tangle of conflicts with my system hotkeys. Do not recommend. :)

Instead, I went with Hammerspoon (hammerspoon.org). Hammerspoon lets you write your own keyboard mappings if you know the Lua programming language. Steps are as follows:

1. Download, install and launch Hammerspoon.
2. A menu icon should appear in the top right of your screen. Click it, then click "Open Config". A Text editor should open.
3. Copy the script into your text editor and customize for your games. Further instructions are available there.
4. Click the Hammerspoon icon again and click "Reload Config". Start your game up and you should have hot keys!

The code maps Command + Alt + [Number Keys] to corresponding function keys, and only applies to the games you specify so you don't need to worry about the rest of your system. Command+Alt+0 maps to F10, Command+Alt+- maps to F11 and Command+Alt+= maps to F12.

Note that the "appName" variable in the code above must match the main window of the game exactly. See attached example screenshot. You can always add more games as well; simply "Open Config" again, edit what's there and "Reload Config".

I hope this is helpful to anyone who experienced the same frustrations I did. Happy gaming!

------------------------------------
-- HammerSpoon GOG Hot Keys
------------------------------------

-- do not edit any code until the appName variables begin!
function applicationWatcher(appName, eventType, appObject)
if (eventType == hs.application.watcher.activated) then
if (
-- edit this list of app names.
appName == "Star Wars™: X-Wing Special Edition" or
appName == "Theme Park" or
appName == "Type the exact name of the game window here"
-- all done! do not edit below this line!
)
then

hs.hotkey.bind({"cmd", "alt"}, "1", function() hs.eventtap.keyStroke({}, "F1") end)
hs.hotkey.bind({"cmd", "alt"}, "2", function() hs.eventtap.keyStroke({}, "F2") end)
hs.hotkey.bind({"cmd", "alt"}, "3", function() hs.eventtap.keyStroke({}, "F3") end)
hs.hotkey.bind({"cmd", "alt"}, "4", function() hs.eventtap.keyStroke({}, "F4") end)
hs.hotkey.bind({"cmd", "alt"}, "5", function() hs.eventtap.keyStroke({}, "F5") end)
hs.hotkey.bind({"cmd", "alt"}, "6", function() hs.eventtap.keyStroke({}, "F6") end)
hs.hotkey.bind({"cmd", "alt"}, "7", function() hs.eventtap.keyStroke({}, "F7") end)
hs.hotkey.bind({"cmd", "alt"}, "8", function() hs.eventtap.keyStroke({}, "F8") end)
hs.hotkey.bind({"cmd", "alt"}, "9", function() hs.eventtap.keyStroke({}, "F9") end)
hs.hotkey.bind({"cmd", "alt"}, "0", function() hs.eventtap.keyStroke({}, "F10") end)
hs.hotkey.bind({"cmd", "alt"}, "-", function() hs.eventtap.keyStroke({}, "F11") end)
hs.hotkey.bind({"cmd", "alt"}, "=", function() hs.eventtap.keyStroke({}, "F12") end)

end
end
end
appWatcher = hs.application.watcher.new(applicationWatcher)
appWatcher:start()

------------------------------------
-- End!
------------------------------------
Attachments:
example.png (291 Kb)
Maybe I'm not reading this correctly, but how is this an advantage over simply pressing the Fn key before pressing the hotkey in order to get the function key output?

When I'm playing a game which relies heavily on the Function keys I like the Function keys to be single-press so I just go to System Preferences > Keyboard > Tick "Use F1, F2, etc. keys as standard function keys".

The disadvantage is that you have to turn it off again when you're not playing the game if you want access to the hotkeys again.
Post edited June 05, 2017 by 01kipper
avatar
01kipper: Maybe I'm not reading this correctly, but how is this an advantage over simply pressing the Fn key before pressing the hotkey in order to get the function key output?

When I'm playing a game which relies heavily on the Function keys I like the Function keys to be single-press so I just go to System Preferences > Keyboard > Tick "Use F1, F2, etc. keys as standard function keys".

The disadvantage is that you have to turn it off again when you're not playing the game if you want access to the hotkeys again.
You covered the first disadvantage. The second might be specific to one's setup. I use an external keyboard. With that, no matter what I did in System Prefs the Mute and Volume Buttons overtook the function keys.

I saw some other posts in various game forums complaining about a similar issue, and figured this solution might be helpful to some.
avatar
jkosoy: I use an external keyboard. With that, no matter what I did in System Prefs the Mute and Volume Buttons overtook the function keys.

I saw some other posts in various game forums complaining about a similar issue, and figured this solution might be helpful to some.
Ah, I see now, I knew I must have been missing something! :)