Files
Bubberstation/code/datums/keybinding/_keybindings.dm
Couls dc5840dc4e keybind signal support, ported from TGMC (#52219)
* keybind signal support, ported from TGMC

* Thank you linter

* remove unused and extra defines

* move signal defines up and fix emote keybind runtimes

* Apply suggestions

* Update keybinding.dm

* Missed this one in the upstream merge

* Ignore keybindings without names

* back to the OG

* Update living.dm

* Update living.dm

* got it

* trailing newline

* Update code/datums/keybinding/living.dm

Co-authored-by: Rohesie <rohesie@gmail.com>

Co-authored-by: Rohesie <rohesie@gmail.com>
2020-07-22 16:53:27 -04:00

28 lines
693 B
Plaintext

/datum/keybinding
var/list/hotkey_keys
var/list/classic_keys
var/name
var/full_name
var/description = ""
var/category = CATEGORY_MISC
var/weight = WEIGHT_LOWEST
var/keybind_signal
/datum/keybinding/New()
if(!keybind_signal)
CRASH("Keybind [src] called unredefined down() without a keybind_signal.")
// Default keys to the master "hotkey_keys"
if(LAZYLEN(hotkey_keys) && !LAZYLEN(classic_keys))
classic_keys = hotkey_keys.Copy()
/datum/keybinding/proc/down(client/user)
SHOULD_CALL_PARENT(TRUE)
return SEND_SIGNAL(user.mob, keybind_signal) & COMSIG_KB_ACTIVATED
/datum/keybinding/proc/up(client/user)
return FALSE
/datum/keybinding/proc/can_use(client/user)
return TRUE