diff --git a/code/modules/keybindings/keybind/mob.dm b/code/modules/keybindings/keybind/mob.dm index 15911d831e..c9b44e7fc3 100644 --- a/code/modules/keybindings/keybind/mob.dm +++ b/code/modules/keybindings/keybind/mob.dm @@ -88,3 +88,19 @@ var/atom/A = user.mouseObject if(A) A.attempt_examinate(user.mob) + +/datum/keybinding/mob/cancel_action + hotkey_keys = list("Unbound") + name = "cancel_action" + full_name = "Cancel Action" + description = "Cancel the current action." + +/datum/keybinding/mob/cancel_action/down(client/user) + var/mob/M = user.mob + if(length(M.do_afters)) + var/atom/target = M.do_afters[M.do_afters.len] + to_chat(M, "You stop interacting with \the [target].") + LAZYREMOVE(M.do_afters, target) + else + to_chat(M, "There's nothing that you can cancel right now.") + return TRUE