Post subject: Typing Input
Experienced player (764)
Joined: 6/17/2008
Posts: 146
I propose a new keyboard input paradigm for frame-based rerecording emulators, which I shall refer to as typing input. Let's look at the two most common designs you might encounter: Pressing Input The user must press and hold keys while advancing a frame. This causes problems with many keyboards, requires great flexibility and requires more fingers than Emacs. Hold Input Pressing and releasing a key toggles the corresponding button's pressed state. This is great for when buttons need to be held for longer durations and is suitable for vi users, but it requires an additional keypress for common usage cases. What I'm proposing is a combination of these two that seeks to work well with common usage cases while also being suitable for vi users. Typing Input Pressing and releasing a key toggles the corresponding button's pressed state. After the user advances a frame, the button is released. This method requires the same amount of keypresses as pressing input while not requiring the user to simultaneously press and hold multiple keys. I call it typing input since it allows for the user to punch in input as if they were typing text instead of playing a game. Typing is what keyboards best suited for and it takes much less energy than pressing and holding five keys at once while not jamming keyboards. Pressing and holding keys is a great paradigm for gamepads, but keyboards are made for typing, not emulating a gamepad. Using different input paradigms for different input devices isn't silly; it's basically required.
Site Admin, Skilled player (1254)
Joined: 4/17/2010
Posts: 11475
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Very good and rather obvious idea. There shall be a checkbox turning emulator to input-toggling mode. Soemthing similar was supposed to be in BizHawks TAStudio, where it's not very good decision, but in old-school frame advance concept it's awesome.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
ALAKTORN
He/Him
Former player
Joined: 10/19/2009
Posts: 2527
Location: Italy
wow, I can’t believe something so obvious has been overlooked for so long… that’s a good idea
Editor, Player (44)
Joined: 7/11/2010
Posts: 1029
What if we want to press and release multiple buttons in sequence within the same frame? (I guess I'm a bit of a special case here, because most consoles are incapable of even receiving such input, but I'm using subframe input all the time in NetHack, which can understand it just fine.)
Experienced player (764)
Joined: 6/17/2008
Posts: 146
ais523 wrote:
What if we want to press and release multiple buttons in sequence within the same frame? (I guess I'm a bit of a special case here, because most consoles are incapable of even receiving such input, but I'm using subframe input all the time in NetHack, which can understand it just fine.)
for frame-based rerecording emulators
Yeah, for JPC-RR and friends, this is a no-go. In related news, the next release of lsnes will have this feature and implementing it in Bizhawk is being planned as well.
ALAKTORN
He/Him
Former player
Joined: 10/19/2009
Posts: 2527
Location: Italy
turska wrote:
In related news, the next release of lsnes will have this feature and implementing it in Bizhawk is being planned as well.
awesome :D
Warepire
He/Him
Editor
Joined: 3/2/2010
Posts: 2178
Location: A little to the left of nowhere (Sweden)
This is really obvious and much needed in many cases. I am surprised it has not been brought up in the proper circles before. Brilliant idea, and it is nice to see that both lsnes and BizHawk is already adapting it. Great thinking turska, makes me ashamed for not have thought of it myself.
Editor, Skilled player (1202)
Joined: 9/27/2008
Posts: 1085
I've already thought of that typing idea while working with MtEdit -- I call it Sticky input. It felt like an obvious enough idea that there was no need to mention it. I'm quite surprised this wasn't thought of by many others, until now. Still, thanks for sharing the idea. At least this idea has gotten much needed awareness, of which I haven't given.
Site Admin, Skilled player (1254)
Joined: 4/17/2010
Posts: 11475
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Edited by creaothceann's suggestion (see below). Download InputToggles.lua
Language: lua

-- feos, 2012 -- Autohold toggles allow to avoid pressing all necessary buttons while frame advancing -- Specify your toggles for each button, add new ones for different platforms -- "start" and "select" may be deleted to save on buttons ;) lastkeys, keys = input.get(), input.get() switches1 = { -- Pad 1 A = {toggle="Q", on=false, val={A=1} }, B = {toggle="W", on=false, val={B=1} }, left = {toggle="E", on=false, val={left=1} }, right = {toggle="R", on=false, val={right=1} }, up = {toggle="T", on=false, val={up=1} }, down = {toggle="Y", on=false, val={down=1} }, start = {toggle="U", on=false, val={start=1} }, select = {toggle="I", on=false, val={select=1}} } switches2 = { -- Pad 2 A = {toggle="A", on=false, val={A=1} }, B = {toggle="S", on=false, val={B=1} }, left = {toggle="D", on=false, val={left=1} }, right = {toggle="F", on=false, val={right=1} }, up = {toggle="G", on=false, val={up=1} }, down = {toggle="H", on=false, val={down=1} }, start = {toggle="J", on=false, val={start=1} }, select = {toggle="K", on=false, val={select=1}} } function InputToggles() keys = input.get() for name, button in pairs(switches1) do if keys[button.toggle] and not lastkeys[button.toggle] then button.on = not button.on end if button.on then joypad.set(1, button.val) end end for name, button in pairs(switches2) do if keys[button.toggle] and not lastkeys[button.toggle] then button.on = not button.on end if button.on then joypad.set(2, button.val) end end lastkeys = keys end emu.registerbefore(InputToggles);
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Download InputToggles.lua
Language: lua

function InputToggles() keys = input.get() for name, button in pairs(switches1) do if keys[button.toggle] and not lastkeys[button.toggle] then button.on = not button.on end if button.on then joypad.set(1, button.val) end end for name, button in pairs(switches2) do if keys[button.toggle] and not lastkeys[button.toggle] then button.on = not button.on end if button.on then joypad.set(2, button.val) end end lastkeys = keys end
Or if you have a wide screen:
function InputToggles()
        keys = input.get()
        for name, button in pairs(switches1) do  if keys[button.toggle] and not lastkeys[button.toggle] then button.on = not button.on  end;  if button.on then joypad.set(1, button.val) end;  end
        for name, button in pairs(switches2) do  if keys[button.toggle] and not lastkeys[button.toggle] then button.on = not button.on  end;  if button.on then joypad.set(2, button.val) end;  end
        lastkeys = keys
end