diff --git a/code/modules/keybindings/setup.dm b/code/modules/keybindings/setup.dm index 8d9867a206c..6b0571dd220 100644 --- a/code/modules/keybindings/setup.dm +++ b/code/modules/keybindings/setup.dm @@ -62,9 +62,13 @@ apply_macro_set(SKIN_MACROSET_CLASSIC_INPUT, SSinput.macroset_classic_input) set_hotkeys_preference() + set_hotkeys_button(prefs_override.hotkeys) /client/proc/set_hotkeys_preference(datum/preferences/prefs_override = prefs) if(prefs_override.hotkeys) winset(src, null, "map.focus=true input.background-color=[COLOR_INPUT_DISABLED] mainwindow.macro=[SKIN_MACROSET_HOTKEYS]") else winset(src, null, "input.focus=true input.background-color=[COLOR_INPUT_ENABLED] mainwindow.macro=[SKIN_MACROSET_CLASSIC_INPUT]") + +/client/proc/set_hotkeys_button(toggled) + winset(src, "hotkey_toggle", "is-checked=[toggled? "true" : "false"]") diff --git a/interface/interface.dm b/interface/interface.dm index b954419eeb3..08a4568d417 100644 --- a/interface/interface.dm +++ b/interface/interface.dm @@ -222,3 +222,13 @@ Any-Mode: (hotkey doesn't need to be on) to_chat(src, other) if(holder) to_chat(src, admin) + +/client/verb/skin_toggle_hotkeys() + set name = "Toggle Hotkeys" + set category = "Preferences" + set desc = "Toggle input control scheme" + set hidden = TRUE + + prefs.hotkeys = !prefs.hotkeys + set_macros() + diff --git a/interface/skin.dmf b/interface/skin.dmf index 338b8e77c21..d2f20ba191d 100644 --- a/interface/skin.dmf +++ b/interface/skin.dmf @@ -216,7 +216,7 @@ window "outputwindow" anchor2 = -1,-1 saved-params = "" text = "Hotkey Toggle" - command = ".winset \"mainwindow.macro!=macro ? mainwindow.macro=macro hotkey_toggle.is-checked=false input.focus=true : mainwindow.macro=hotkeymode hotkey_toggle.is-checked=true mapwindow.map.focus=true\"" + command = "Toggle-Hotkeys" button-type = pushbox elem "output" type = OUTPUT