From 0606a77760325b7778f1dd47f78cbf48b8126d25 Mon Sep 17 00:00:00 2001 From: cracyc Date: Wed, 20 Nov 2019 21:35:35 -0600 Subject: plugins/cheat: show pressed buttons when setting hotkeys (nw) --- plugins/cheat/init.lua | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'plugins/cheat/init.lua') diff --git a/plugins/cheat/init.lua b/plugins/cheat/init.lua index 21824626977..35378f1a43e 100644 --- a/plugins/cheat/init.lua +++ b/plugins/cheat/init.lua @@ -536,8 +536,21 @@ function cheat.startplugin() manager:machine():video():frame_update(true) input:seq_poll_start("switch") local time = os.clock() - while (not input:seq_poll()) and (os.clock() < time + 1) do end - cheat.hotkeys = {pressed = false, keys = input:seq_poll_final()} + while (not input:seq_poll()) and (os.clock() < time + 1) do + if input:seq_poll_modified() then + if not input:seq_poll_valid() then + manager:machine():popmessage(_("Invalid sequence entered")) + break + end + manager:machine():popmessage(input:seq_name(input:seq_poll_sequence())) + manager:machine():video():frame_update(true) + end + end + if input:seq_poll_valid() then + cheat.hotkeys = {pressed = false, keys = input:seq_poll_final()} + else + cheat.hotkeys = nil + end manager:machine():popmessage() manager:machine():video():frame_update(true) end -- cgit v1.2.3-70-g09d2