Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't type the @ symbol #418

Open
araghon007 opened this issue Apr 5, 2023 · 7 comments
Open

Can't type the @ symbol #418

araghon007 opened this issue Apr 5, 2023 · 7 comments
Labels

Comments

@araghon007
Copy link

So, I have a relatively weird keyboard layout, where you have to press Ctrl+Alt+V (AltGr+V) to type the @ symbol.

else if ((Keyboard.keys.Contains(Keys.LeftControl) || Keyboard.keys.Contains(Keys.RightControl))
&& key == Keys.V)
{
textInputControlDown[6] = true;
TextInputEXT.OnTextInput(FNAPlatform.TextInputCharacters[6]);
textInputSuppress = true;
}

else if ((Keyboard.keys.Contains(Keys.LeftControl) || Keyboard.keys.Contains(Keys.RightControl))
&& key == Keys.V)
{
TextInputEXT.OnTextInput(FNAPlatform.TextInputCharacters[6]);
}

I'm not entirely sure how to fix this properly, but it seems checking if Left Alt and Right Alt aren't pressed does the trick. I know Ctrl+Shift+V pastes normally on Windows, so Alt seems to be the only special key that changes the behavior.

@flibitijibibo
Copy link
Member

I want to say that the issue could be less about the keys and more about the mod state... I do know we have support in SDL for alt/shift/etc but I don't know if it would be applicable to this situation - ideally we could get an event that explicitly asks for a paste operation, so that we aren't manually checking keys like this.

This is wild speculation on my part though; if there's not a graceful way to get the paste request I'd be okay with adding checks for Alt keys being released.

@araghon007
Copy link
Author

I did see a mention of SDL_CLIPBOARDUPDATE elsewhere emscripten-ports/SDL2#125 (comment)
however the best I could find about that event is that it may be experimental and triggers on.. clipboard update.

@araghon007
Copy link
Author

Now that I think about it, what's the reason for using textInputSuppress? It's only set when Ctrl+V are pressed, and only used with the SDL_TEXTINPUT event, however pressing Ctrl+V doesn't trigger the text input event on Windows. I'm guessing it's an issue with a different platform then?

@flibitijibibo
Copy link
Member

I believe so, yes - that's been there for close to 9 years though, so it's been a while since we've really looked at this portion thoroughly 😅

@flibitijibibo
Copy link
Member

Correction, it's been almost 10 years!

flibitijibibo/FNA-MGHistory#96

@araghon007
Copy link
Author

Oh wow, I've tried following the blame trail, but I didn't know about the archive repo. Also, thanks for the speedy replies.

@Karm
Copy link

Karm commented Jun 1, 2023

@flibitijibibo / @araghon007 You guys might be interested in: pthom/hello_imgui#3 (comment)
...that is regarding Emcripten, SDL and Copy/Paste events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants