Skip to content

Instantly share code, notes, and snippets.

@bendanm
Last active September 21, 2025 05:48
Show Gist options
  • Select an option

  • Save bendanm/008f530be6f36d329f9f7f82268d44b9 to your computer and use it in GitHub Desktop.

Select an option

Save bendanm/008f530be6f36d329f9f7f82268d44b9 to your computer and use it in GitHub Desktop.
Beyond All Reason grid keybindings plus all extra files
// Custom keybindings based on Grid keys default.
//
// This combines all the files for grid keys referened in gird_keys.txt
// into one giant file for easy editing.
// https://github.com/beyond-all-reason/Beyond-All-Reason/blob/master/luaui/configs/hotkeys/grid_keys.txt
//
// If there are changes to widgets such as the grid keys or the unit
// control group system you may need to go the the subsection for these files
// and paste in the updated bindings.
// Clears all other bindings that might have been set before we loaded this file.
unbindall // clear the defaults
unbind enter chat // clear the defaults
// Setup fake meta
// The `Meta` key is the "windows" key
// fakemeta means spacebar can be used in place of the windows key
// in the same way as the Ctrl+ or Alt+
fakemeta space
///////////////////////////////////////////////////////////
// This section is from the chat_and_ui_keys.txt file
// https://github.com/beyond-all-reason/Beyond-All-Reason/blob/master/luaui/configs/hotkeys/chat_and_ui_keys.txt
///////////////////////////////////////////////////////////
// common interface keys
bind esc select AllMap++_ClearSelection_SelectNum_0+
bind esc quitmessage
bind Shift+esc quitmenu
bind Ctrl+Shift+esc quitforce
bind Alt+Shift+esc reloadforce
bind Any+escape edit_escape
bind Any+pause pause
bind esc teamstatus_close
bind esc customgameinfo_close
bind esc buildmenu_pregame_deselect
bind Alt+backspace fullscreen
// common selectbox keys
bind Any+sc_z selectbox_same // select only units that share type with current selection modifier | Smart Select Widget
bind Any+space selectbox_idle // select only idle units modifier | Smart Select Widget
bind Any+shift selectbox_append // append to selection modifier | Smart Select Widget
bind Any+shift selectbox_any // select all units modifier | Smart Select Widget
bind Any+ctrl selectbox_deselect // remove units from current selection modifier | Smart Select Widget
bind Any+alt selectbox_mobile // select only mobile units modifier | Smart Select Widget
bind Any+space selectloop // activate select shape | Loop Select Widget
bind Any+ctrl selectloop_invert // select units not present in current selection modifier | Loop Select Widget
bind Any+shift selectloop_add // add to selection modifier | Loop Select Widget
bind Any+space buildsplit // activate build split mode (distribute orders between selected builders) | Build Split Widget
// commandinsert keys
bind Any+space commandinsert prepend_between // prepend command into the queue between 2 commands close to cursor
// bind Any+space commandinsert prepend_queue // prepend command into a separate prepend queue until key released
// common chat keys
bind Any+enter chat
bind Alt+ctrl+sc_a chatswitchally
bind Alt+ctrl+sc_s chatswitchspec
bind Any+tab edit_complete
bind Any+backspace edit_backspace
bind Any+delete edit_delete
bind Any+home edit_home
bind Alt+left edit_home
bind Any+end edit_end
bind Alt+right edit_end
bind Any+up edit_prev_line
bind Any+down edit_next_line
bind Any+left edit_prev_char
bind Any+right edit_next_char
bind Ctrl+left edit_prev_word
bind Ctrl+right edit_next_word
bind Any+enter edit_return
bind Ctrl+v pastetext
// common camera controls
bind Any+up moveforward
bind Any+down moveback
bind Any+right moveright
bind Any+left moveleft
bind Any+pageup moveup
bind Any+pagedown movedown
bind Any+alt movereset // fast camera reset on mousewheel
bind Any+alt moverotate // rotate on x,y with mmb hold + move (Spring Camera)
bind Any+ctrl movetilt // rotate on x with mousewheel
///////////////////////////////////////////////////////////
// From gridmenu_keys.txt
// https://github.com/beyond-all-reason/Beyond-All-Reason/blob/master/luaui/configs/hotkeys/gridmenu_keys.txt
///////////////////////////////////////////////////////////
bind sc_z gridmenu_category 1
bind sc_x gridmenu_category 2
bind sc_c gridmenu_category 3
bind sc_v gridmenu_category 4
bind Shift+sc_z gridmenu_category 1
bind Shift+sc_x gridmenu_category 2
bind Shift+sc_c gridmenu_category 3
bind Shift+sc_v gridmenu_category 4
bind Any+sc_z gridmenu_key 1 1
bind Any+sc_x gridmenu_key 1 2
bind Any+sc_c gridmenu_key 1 3
bind Any+sc_v gridmenu_key 1 4
bind Any+sc_a gridmenu_key 2 1
bind Any+sc_s gridmenu_key 2 2
bind Any+sc_d gridmenu_key 2 3
bind Any+sc_f gridmenu_key 2 4
bind Any+sc_q gridmenu_key 3 1
bind Any+sc_w gridmenu_key 3 2
bind Any+sc_e gridmenu_key 3 3
bind Any+sc_r gridmenu_key 3 4
bind sc_b gridmenu_next_page
bind sc_. gridmenu_cycle_builder
///////////////////////////////////////////////////////////
// From num_keys.txt
// https://github.com/beyond-all-reason/Beyond-All-Reason/blob/master/luaui/configs/hotkeys/num_keys.txt
///////////////////////////////////////////////////////////
bind 1 specteam 0
bind 2 specteam 1
bind 3 specteam 2
bind 4 specteam 3
bind 5 specteam 4
bind 6 specteam 5
bind 7 specteam 6
bind 8 specteam 7
bind 9 specteam 8
bind Alt+0 add_to_autogroup 0
bind Alt+1 add_to_autogroup 1
bind Alt+2 add_to_autogroup 2
bind Alt+3 add_to_autogroup 3
bind Alt+4 add_to_autogroup 4
bind Alt+5 add_to_autogroup 5
bind Alt+6 add_to_autogroup 6
bind Alt+7 add_to_autogroup 7
bind Alt+8 add_to_autogroup 8
bind Alt+9 add_to_autogroup 9
bind Shift+Alt+0 load_autogroup_preset 0
bind Shift+Alt+1 load_autogroup_preset 1
bind Shift+Alt+2 load_autogroup_preset 2
bind Shift+Alt+3 load_autogroup_preset 3
bind Shift+Alt+4 load_autogroup_preset 4
bind Shift+Alt+5 load_autogroup_preset 5
bind Shift+Alt+6 load_autogroup_preset 6
bind Shift+Alt+7 load_autogroup_preset 7
bind Shift+Alt+8 load_autogroup_preset 8
bind Shift+Alt+9 load_autogroup_preset 9
bind 0,0 group focus 0
bind 1,1 group focus 1
bind 2,2 group focus 2
bind 3,3 group focus 3
bind 4,4 group focus 4
bind 5,5 group focus 5
bind 6,6 group focus 6
bind 7,7 group focus 7
bind 8,8 group focus 8
bind 9,9 group focus 9
bind 0 group select 0
bind 1 group select 1
bind 2 group select 2
bind 3 group select 3
bind 4 group select 4
bind 5 group select 5
bind 6 group select 6
bind 7 group select 7
bind 8 group select 8
bind 9 group select 9
bind Ctrl+0 group set 0
bind Ctrl+1 group set 1
bind Ctrl+2 group set 2
bind Ctrl+3 group set 3
bind Ctrl+4 group set 4
bind Ctrl+5 group set 5
bind Ctrl+6 group set 6
bind Ctrl+7 group set 7
bind Ctrl+8 group set 8
bind Ctrl+9 group set 9
bind Shift+0 group selectadd 0
bind Shift+1 group selectadd 1
bind Shift+2 group selectadd 2
bind Shift+3 group selectadd 3
bind Shift+4 group selectadd 4
bind Shift+5 group selectadd 5
bind Shift+6 group selectadd 6
bind Shift+7 group selectadd 7
bind Shift+8 group selectadd 8
bind Shift+9 group selectadd 9
bind Ctrl+Shift+0 group add 0
bind Ctrl+Shift+1 group add 1
bind Ctrl+Shift+2 group add 2
bind Ctrl+Shift+3 group add 3
bind Ctrl+Shift+4 group add 4
bind Ctrl+Shift+5 group add 5
bind Ctrl+Shift+6 group add 6
bind Ctrl+Shift+7 group add 7
bind Ctrl+Shift+8 group add 8
bind Ctrl+Shift+9 group add 9
bind Ctrl+Alt+0 group selecttoggle 0
bind Ctrl+Alt+1 group selecttoggle 1
bind Ctrl+Alt+2 group selecttoggle 2
bind Ctrl+Alt+3 group selecttoggle 3
bind Ctrl+Alt+4 group selecttoggle 4
bind Ctrl+Alt+5 group selecttoggle 5
bind Ctrl+Alt+6 group selecttoggle 6
bind Ctrl+Alt+7 group selecttoggle 7
bind Ctrl+Alt+8 group selecttoggle 8
bind Ctrl+Alt+9 group selecttoggle 9
/////////////////////////////////////////////////
// From grid_keys.txt
// https://github.com/beyond-all-reason/Beyond-All-Reason/blob/master/luaui/configs/hotkeys/grid_keys.txt
//
// The "Load common keys" has been replaced and
// copied into this file in the sections above.
/////////////////////////////////////////////////
bind Alt+sc_= increasespeed
bind Alt+sc_- decreasespeed
bind Alt+numpad+ increasespeed
bind Alt+numpad- decreasespeed
bind sc_[ buildfacing inc
bind Shift+sc_[ buildfacing inc
bind sc_] buildfacing dec
bind Shift+sc_] buildfacing dec
bind Alt+sc_z buildspacing inc
bind Shift+Alt+sc_z buildspacing inc
bind Alt+sc_x buildspacing dec
bind Shift+Alt+sc_x buildspacing dec
bind sc_a attack
bind Shift+sc_a attack
bind Ctrl+sc_a areaattack
bind Ctrl+Shift+sc_a areaattack
bind Ctrl+sc_b selfd
bind Ctrl+Shift+sc_b selfd queued
bind sc_d manualfire
bind Shift+sc_d manualfire
bind sc_d manuallaunch
bind Shift+sc_d manuallaunch
bind sc_e reclaim
bind Shift+sc_e reclaim
bind sc_f fight
bind Shift+sc_f fight
bind Alt+sc_f chain force forcestart | say !cv forcestart
bind sc_g stopproduction
bind Shift+sc_g stopproduction
bind sc_g stop
bind Shift+sc_g stop
bind sc_h patrol
bind Shift+sc_h patrol
bind sc_i unit_stats
bind Ctrl+sc_i customgameinfo
bind sc_j loadunits
bind Shift+sc_j loadunits
bind sc_k cloak
bind Shift+sc_k cloak
bind sc_k wantcloak
bind Any+sc_k wantcloak
bind sc_m restore
bind Shift+sc_m restore
bind sc_n command_skip_current
bind Ctrl+sc_n command_cancel_last
bind sc_o guard
bind Shift+sc_o guard
bind sc_y gatherwait // Swapped p and y
bind Shift+sc_y gatherwait // Swapped p and y
bind sc_r repair
bind Shift+sc_r repair
bind sc_s settarget
bind Shift+sc_s settarget
bind Alt+sc_s settargetnoground
bind Shift+Alt+sc_s settargetnoground
bind Ctrl+sc_s canceltarget
bind sc_u unloadunits
bind Shift+sc_u unloadunits
bind sc_w resurrect
bind Shift+sc_w resurrect
bind sc_w capture
bind Shift+sc_w capture
bind sc_p wait // Swapped p and y
bind Shift+sc_p wait queued // Swapped p and y
bind sc_b,sc_b onoff 0
bind sc_b onoff 1
bind Shift+sc_b,Shift+sc_b onoff 0
bind Shift+sc_b onoff 1
bind sc_b,sc_b,sc_b trajectory_toggle 1
bind sc_b,sc_b trajectory_toggle 0
bind sc_b trajectory_toggle 2
bind Shift+sc_b,Shift+sc_b,Shift+sc_b trajectory_toggle 1
bind Shift+sc_b,Shift+sc_b trajectory_toggle 0
bind Shift+sc_b trajectory_toggle 2
bind sc_l,sc_l,sc_l firestate 1
bind sc_l,sc_l firestate 0
bind sc_l firestate 2
bind Shift+sc_l,Shift+sc_l,Shift+sc_l firestate 1
bind Shift+sc_l,Shift+sc_l firestate 0
bind Shift+sc_l firestate 2
bind sc_;,sc_;,sc_; movestate 1
bind sc_;,sc_; movestate 0
bind sc_; movestate 2
bind Shift+sc_;,Shift+sc_;,Shift+sc_; movestate 1
bind Shift+sc_;,Shift+sc_; movestate 0
bind Shift+sc_; movestate 2
bind sc_t,sc_t repeat 0
bind sc_t repeat 1
bind Shift+sc_t,Shift+sc_t repeat 0
bind Shift+sc_t repeat 1
bind Ctrl+sc_g,Ctrl+sc_g factoryguard 0
bind Ctrl+sc_g factoryguard 1
bind Any+sc_' togglelos
bind Ctrl+sc_t toggleoverview
bind Alt+sc_o cameraflip
bind Ctrl+f5 viewta
bind Ctrl+f6 viewspring
bind Ctrl+f7 HideInterface
bind Any+f5 LastMsgPos
bind Any+f6 ShowPathTraversability
bind Any+f7 ShowMetalMap
bind Any+f8 ShowElevation
bind f10 options
bind f11 luaui selector
bind Any+f12 screenshot png
bind Ctrl+sc_` group unset
bind Alt+sc_` remove_from_autogroup
bind sc_`,sc_` drawlabel
bind Any+\ drawlabel // Added so you can do \+Enter to quick ping
bind sc_` drawinmap
bind Ctrl+sc_e select AllMap++_ClearSelection_SelectAll+
bind Ctrl+tab select AllMap+_Builder_Idle+_ClearSelection_SelectOne+
bind Shift+tab selectcomm append
bind tab selectcomm focus
bind sc_q select Visible+_InPrevSel+_ClearSelection_SelectAll+
bind Ctrl+sc_q select PrevSelection++_ClearSelection_SelectPart_50+
bind Ctrl+sc_w select AllMap+_InPrevSel+_ClearSelection_SelectAll+
bind Ctrl+sc_r select AllMap+_Transport_Idle+_ClearSelection_SelectAll+
bind Ctrl+sc_y select Visible+_Waiting+_ClearSelection_SelectAll+
// numpad movement
bind numpad2 moveback
bind numpad6 moveright
bind numpad4 moveleft
bind numpad8 moveforward
bind numpad9 moveup
bind numpad3 movedown
bind numpad1 movefast
// snd_volume_osd
bind backspace MuteSound
bind numpad+ snd_volume_increase
bind sc_= snd_volume_increase
bind sc_- snd_volume_decrease
bind numpad- snd_volume_decrease
// camera anchors
// Disabling original camera anchors and swapping to meta+f1
// bind Ctrl+F1 set_camera_anchor 1
// bind Ctrl+F2 set_camera_anchor 2
// bind Ctrl+F3 set_camera_anchor 3
// bind Ctrl+F4 set_camera_anchor 4
// bind F1 focus_camera_anchor 1
// bind F2 focus_camera_anchor 2
// bind F3 focus_camera_anchor 3
// bind F4 focus_camera_anchor 4
// Swapping to meta+f-keys for camera anchor
bind Ctrl+meta+f1 set_camera_anchor 1
bind Ctrl+meta+f2 set_camera_anchor 2
bind Ctrl+meta+f3 set_camera_anchor 3
bind Ctrl+meta+f4 set_camera_anchor 4
bind meta+f1 focus_camera_anchor 1
bind meta+f2 focus_camera_anchor 2
bind meta+f3 focus_camera_anchor 3
bind meta+f4 focus_camera_anchor 4
// blueprint
bind Alt+sc_b blueprint_place
bind Alt+sc_c blueprint_create
bind Alt+sc_d blueprint_delete
bind Alt+sc_[ blueprint_prev
bind Alt+sc_] blueprint_next
// quotas
bind Alt+sc_g factoryqueuemode
/////////////////////////////////////////////////
// Custom personal bindings
/////////////////////////////////////////////////
// For labs - the query is selecting everything *not* a builder
// select - similar on screen
// double - healthy units from previous selection
// alt - damaged units from previous selection
// ctrl - split group in half
// meta - split off a 6 unit task force
unbindkeyset ctrl+sc_q
unbindkeyset sc_q
bind sc_q,sc_q select PrevSelection+_Not_Building_RelativeHealth_80+_ClearSelection_SelectAll+
bind alt+sc_q select PrevSelection+_Not_Building_Not_RelativeHealth_80+_ClearSelection_SelectAll+
bind meta+sc_q chain force select PrevSelection+_Not_Building+_ClearSelection_SelectNum_6+ | group unset
bind ctrl+sc_q select PrevSelection++_ClearSelection_SelectPart_50+
bind sc_q select Visible+_InPrevSel+_ClearSelection_SelectAll+
// Labs
// f1 - select all labs
// ctrl - rotate through all labs
bind ctrl+f1 select AllMap+_Builder_Building_Not_IdMatches_armnanotc_Not_IdMatches_armnanotcp_Not_IdMatches_armnanotc2_Not_IdMatches_cornanotc_Not_IdMatches_cornanotcp_Not_IdMatches_cornanotc2_Not_IdMatches_legnanotc_Not_IdMatches_legnanotcp_Not_IdMatches_legnanotc2+_ClearSelection_SelectOne+
bind f1 select AllMap+_Builder_Building_Not_IdMatches_armnanotc_Not_IdMatches_armnanotcp_Not_IdMatches_armnanotc2_Not_IdMatches_cornanotc_Not_IdMatches_cornanotcp_Not_IdMatches_cornanotc2_Not_IdMatches_legnanotc_Not_IdMatches_legnanotcp_Not_IdMatches_legnanotc2+_ClearSelection_SelectAll+
// T2 builders and combat engineers
// f2 - Cycle through T2 builders
// ctrl - all T2 combat engineers
// alt - closest combat engineer or rez bot
bind alt+f2 select AllMap+_Builder_Not_Building_IdMatches_corfast_IdMatches_armconsul_IdMatches_legaceb_IdMatches_armrectr_IdMatches_cornecro_IdMatches_legrezbot+_ClearSelection_SelectClosestToCursor+
bind ctrl+f2 select AllMap+_Builder_Not_Building_IdMatches_corfast_IdMatches_armconsul_IdMatches_legaceb+_ClearSelection_SelectAll+
bind f2 chain force select AllMap+_Builder_Not_Building_IdMatches_armaca_IdMatches_armacv_IdMatches_armack_IdMatches_armacsub_IdMatches_coraca_IdMatches_coracv_IdMatches_corack_IdMatches_coracsub_IdMatches_legaca_IdMatches_legack_IdMatches_legacv+_ClearSelection_SelectOne+ | viewselection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment