Skip to content

Enable q/Q key mode#353

Closed
camierjs wants to merge 2 commits intocomplex-gf-visfrom
qkey
Closed

Enable q/Q key mode#353
camierjs wants to merge 2 commits intocomplex-gf-visfrom
qkey

Conversation

@camierjs
Copy link
Copy Markdown
Contributor

Turns the KeyQPressed into a KeyDelegate and add the Window::SwitchSolution.

@camierjs camierjs self-assigned this Jan 30, 2026
@camierjs camierjs added this to the glvis-4.5 milestone Jan 30, 2026
@camierjs camierjs mentioned this pull request Jan 30, 2026
44 tasks
Comment on lines +98 to +101
void setOnKeyDown(SDL_Keycode key, KeyDelegate func)
{
onKeyDown[key] = [func](SDL_Keymod) { func(SDL_GetModState()); };
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not to pass the argument there? There have been historically problems with SDL_GetModState(), I think.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried, but it is clamped to KMOD_NONE (0).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the SdlWindow::mouseEvents seems to use it too.

Copy link
Copy Markdown
Contributor

@najlkin najlkin Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, with mouse it is easy, but with keys it is more complicated, because some layouts need modifiers for keys to be translated and then the modifier is removed. But worse, there has been some platform specific behavior of the function, I think 🤔 .

@camierjs
Copy link
Copy Markdown
Contributor Author

Closing for in-place solution in #336

@camierjs camierjs closed this Jan 30, 2026
@camierjs camierjs deleted the qkey branch February 5, 2026 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants