Posted June 05, 2017
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!
------------------------------------
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!
------------------------------------