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

Add some Keys #5400

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft

Add some Keys #5400

wants to merge 7 commits into from

Conversation

rustbasic
Copy link
Contributor

@rustbasic rustbasic commented Nov 24, 2024

Add some Keys :

CapsLock,
NumLock,
ScrollLock,

Alt,
AltRight,
Control,
ControlRight,
Shift,
ShiftRight,

Copy link

Preview available at https://egui-pr-preview.github.io/pr/5400-patch150
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

@JRoper18
Copy link

JRoper18 commented Nov 29, 2024

Hey, I'd love this feature. My usecase is having special stuff happen when someone hits the CTRL key. Any hope of getting it merged in?

Comment on lines 32 to 37
Alt,
AltRight,
Control,
ControlRight,
Shift,
ShiftRight,
Copy link
Owner

Choose a reason for hiding this comment

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

A) it's weird that there is both Alt and AltRight, but not AltLeft
B) on the PR preview (https://egui-pr-preview.github.io/pr/5400-patch150/) the Right versions doesn't work at all.

I think we either should just have a single Alt, OR we should have AltLeft and AltRight, and make sure it works everywhere

Copy link
Contributor Author

@rustbasic rustbasic Dec 4, 2024

Choose a reason for hiding this comment

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

Here, Alt, Ctrl, and Shift basically mean Left.
=> Marked as Left and Right.

logical_key.or(physical_key) to physical_key.or(logical_key)
This works fine, but I'm not sure if it has any negative effects elsewhere.

@rustbasic rustbasic requested a review from emilk December 4, 2024 17:36
@emilk emilk added the egui label Dec 12, 2024
@emilk
Copy link
Owner

emilk commented Dec 12, 2024

This doesn't work at all in the web demo at https://egui-pr-preview.github.io/pr/5400-patch150/:
image

@emilk emilk marked this pull request as draft December 12, 2024 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need to Distinguish Left and Right Keys for "Ctrl, Alt, Shift" on the Keyboard
3 participants