-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
105 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bef20d0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the future we should handle
altdown
in thei_input.c
code, e.g. usingSDL_GetModState()
and settingevent->data4
for this, or similar.bef20d0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if
SDL_GetModState()
would help, the problem is that SDL_TEXTINPUT allows alt-key combinations for character input.I thought about rewriting the chat widget, Doom chat was never good. But it's only worth it if we improve the multiplayer significantly (at least solve the frame interpolation problem).
bef20d0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, the problem is to tell apart the character that is reached by pressing Alt+Number from the macro that is reached by the same keys?
bef20d0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
Also I don't know which special keys (like Enter, Esc, Alt) trigger
SDL_TEXTINPUT
events, it's not documented. Looks like keyboard input has been improved in SDL3: https://wiki.libsdl.org/SDL3/BestKeyboardPracticesbef20d0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds pretty much like what we already have in SDL2. I'd say we are already following best practice in this regard.
However, this article precisely describes our dilemma: You either track key presses or you receive text, but not both at the same time.
bef20d0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's why I think we should just rewrite it. Allow cursor movement, a little chat history, and so on. And remove the macros.
But all this work is pointless, as multiplayer is almost unplayable. No interpolation, horrible lags, etc. If we fix multiplayer, it would be interesting to integrate it into the menu, rewrite the chat, maybe even add a "modern" coop mode.
bef20d0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are all very noble goals!
However, I don't want to let the "perfect become the enemy of the good." In this case, not fix all the little annoyances that we have now, because we are planning to replace everything with something better anyway.
bef20d0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But SDL_TEXTINPUT and Alt-Num macros are not working well. I think the old chat is broken - no cursor movement, Del and Esc don't work. I don't feel motivated to improve it without at least fixing the mutiplayer interpolation.