bindable action buttons (#81371)

## About The Pull Request
### work started 12/12/2023


you may alt-click action buttons to bind them to a key
these are subject to click cooldown and if an action successfully
triggers click cooldown is triggered so you cant instantly do multiple
alt-click again to unbind
## Why It's Good For The Game

moving your mouse to the top left corner to do combat is not good
gameplay

## Changelog
🆑
qol: you may altclick action buttons to bind them to a key
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
This commit is contained in:
jimmyl
2024-02-16 23:10:15 +01:00
committed by GitHub
co-authored by MrMelbert
parent 17a470d8ad
commit 683e2ecfbf
10 changed files with 326 additions and 6 deletions
+2 -3
View File
@@ -75,11 +75,10 @@
if(kb.can_use(src) && kb.down(src) && keycount >= MAX_COMMANDS_PER_KEY)
break
holder?.key_down(_key, src)
mob.focus?.key_down(_key, src)
holder?.key_down(_key, src, full_key)
mob.focus?.key_down(_key, src, full_key)
mob.update_mouse_pointer()
/client/verb/keyUp(_key as text)
set instant = TRUE
set hidden = TRUE
+2 -1
View File
@@ -1,6 +1,7 @@
// Set a client's focus to an object and override these procs on that object to let it handle keypresses
/datum/proc/key_down(key, client/user) // Called when a key is pressed down initially
/datum/proc/key_down(key, client/user, full_key) // Called when a key is pressed down initially
SHOULD_CALL_PARENT(TRUE)
return
/datum/proc/key_up(key, client/user) // Called when a key is released
return