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

Access to native js events #1472

Merged
merged 1 commit into from
Sep 16, 2023
Merged

Access to native js events #1472

merged 1 commit into from
Sep 16, 2023

Conversation

RblSb
Copy link
Contributor

@RblSb RblSb commented Sep 16, 2023

I use this to update state of shift/alt/ctrl keys in my user code keys map, when clicking canvas, because keys is not always updated in keydown/up. For example, if you open console with shift-ctrl-i, modifiers will stuck as pressed.
Usage example:

#if kha_html5
final e = SystemImpl.activeMouseEvent ?? return;
// when keyup happens with unfocused window
keys.set(Shift, e.shiftKey);
keys.set(Control, e.ctrlKey);
keys.set(Alt, e.altKey);
keys.set(Meta, e.metaKey);
#end
// ... handle Alt + Click, etc

@RobDangerous RobDangerous merged commit 9e08711 into Kode:main Sep 16, 2023
23 checks passed
@RblSb RblSb deleted the patch-1 branch September 16, 2023 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants