Output last key pressed and hold it until another one is pressed

I’m having trouble trying to program a small subpatch. I’m sure the solution is super simple, but I can’t figure it out.

I want to have the subpatch take the input from the keys 1-8 on my computer’s keyboard number row and simply have one output pin with the last key pressed so it can control a switch.

I want the patch to simply output, say, the number 1 when I hit the 1 key until I hit the 3 key, then it will output 3. Then it will output 3 until I hit the 5 key, and it will output 5 until I hit another key, ect.

I can’t figure it out for the life of me, but I’m sure I’ll be kicking myself for being stupid when someone tells me how. Thank you!

RadioKeyMatch (String)

much simplier way

woeiKeys.v4p (7.1 kB)

have you seen the help patch of RadioKeyMatch? ;)

)))… no text …

my solution comes from here

tonfilmKeys.v4p (19.6 kB)