5 ms·
This might be a dumb question, but why would I want to detect a Keyup event in the first place?
by dec0dedab0de 5y ago
This might be a dumb question, but why would I want to detect a Keyup event in the first place?
- dragontamer 5y agoLets say you're porting a fighting game, such as Blazblue, to Linux. Carl Clover (Blazblue character) attacks on keydown, while Carl's doll attacks on key-up. Expert players change the rhythms of their key-down / key-up to make combos possible. In general, these kinds of fighting game characters are called 'Negative Edge' characters. There's a large number of them in many different fighting games. I know its present in Street Fighter, Marvel vs Capcom, Mortal Kombat, and Injustice. Even SSB:U (Shield-release / perfect shields) is a negative-edge event, showing just how common negative-edges have become in modern games. I personally am only really good at Blazblue: and thus, I know that Carl Clover, and to a lesser extent Taokaka and Lichi are negative-edge characters. Its an entire "character design" philosophy, to make certain characters feel much different from others. But its all over the place. ---------- I HATE playing negative edge characters. If I realize a character has negative-edges, I run the heck away from them. Nonetheless, I accept that fighting games are fun because there's "always a character" that matches someone's personality. If someone else has fun playing negative edge characters, I want to welcome them into the community, and therefore want to support negative-edge gameplay into a game. Its not about "me", its about "the community of players".
- theon144 5y agoThe problem isn't Linux, but the terminal environment...
- dragontamer 5y agoThen lets say a hypothetical terminal video game that acts on negative-edges. My point: negative-edge gameplay is common in fighting games (and maybe other video games). Its reasonable to expect that a video game designer would use that technique. I've played terminal action games before. Lets say you're programming one and have some useful function mapped to the negative edge. How do you implement that in the terminal? -------- Megaman's charge shot (and most "charge shot" video games, including Samus / Metroid, Rocket Knight Adventures, etc. etc.) Maybe those platformers are more common? Either way, the negative-edge is all over video games, its a good control scheme.
- zekica 5y agoYou can interface with input devices directly if you want that. The output can still be in an VT10x terminal, or it can be directly in a framebuffer if you want software rendered graphics. Or better yet! X11 or Wayland.
- zokier 5y agoAs you have discovered, terminal is not really an good environment for games. Its really just that simple. If you pick terminal as your platform, you are intentionally picking a limited platform, and working within those limits is then kinda the point. Having poor input handling is part of those limits. If you just want to make a good game, then just use Wayland (or X11) instead or some wrapper of those.
- dragontamer 5y agoThe Linux terminal is not a good environment for that. The Windows terminal supports key-up events... as long as I can remember anyway. I think a number of Windows programmers who are looking at Linux's command-line API wonder why its so hard to get something that's common in Windows.
- recursive 5y agoOr even simpler. Let's say you're porting a side scrolling old school Mario-type game. When you release the "move right" key, the guy stops moving right.
- dragontamer 5y agoLol. KISS bites me again.
- klyrs 5y agoSimplicity is boring. Thanks for writing that comment. I learned something new about games I've only played casually (by which I mean, button-mashing)
- dragontamer 5y agoFor Blazblue specifically, I'm not a Carl player (ugggh... negative edges). But just remember: whenever the doll is attacking, it reacted to the player LETTING GO of a button (key-up). All of Carl's moves himself are on key-down. So think of what your fingers must do to consistently pull off combos like: https://youtu.be/D8gPPB9YD6s?t=65 https://youtu.be/D8gPPB9YD6s?t=65 You get the benefit of playing two-characters vs the opponent's one character, but it means having to think about both characters (as well as having a wonky control scheme for the 2nd character). Furthermore, Carl is designed to play with the doll, so you only deal the same damage as everyone else if you successfully pull off these combos. But having two-characters means you can setup unblockables more easily (doll hits high, Carl hits low), or weird pressure strings / frame traps that are unavailable to most typical characters. Which is where Carl's unique advantage really comes in. So its not a "damage" thing, its more about the mind-games you play with the opponent when its 2vs1. Terminology: A, B, C, and D are the four attack buttons in the game. Numbers represent which direction you push (2A means A-button while holding "Down". 2 is down on the numpad. 8 is up, 6 is right, 4 is left). Every fighting game community has invented their own terminology. But knowing this should give you enough information to watch that combo-tutorial adequately. A, B, C map to Carl, D maps to the doll. Holding D means that the doll starts to move left-right (4 or 6 with your left hand), letting go of D means that the doll attacks (negative edging). A, B, and C on Carl play as a typical fighting game character. Carl is... not easy... to play.
- theon144 5y agoRTFA >In my case, the goal was to remotely navigate a robot over an SSH connection using the 'w', 'a', 's', 'd' keys. Real-time tasks like this require extremely high responsiveness to key events for palatable performance. Yeah, I don't think a SSH connection is the right tool either, but there's the answer (and basically the entire article follows from that).
- fl0wenol 5y agoIn retrospect, thinking about the end problem, he really should have written a custom front-end that used SSH (or TLS) and a custom protocol to remotely send input and receive telemetry, as most term emus don't support this kind of behavior. It could still be a TUI, but it'd be local and use evdev. What'd be nice is then you could actually use a joystick if you had one ^_^
- silon42 5y agoTo properly implement something like Ctrl+Tab for switching between tabs (assuming application has such a concept).