Skip to content

Add some Keys#5400

Draft
rustbasic wants to merge 7 commits intoemilk:mainfrom
rustbasic:patch150
Draft

Add some Keys#5400
rustbasic wants to merge 7 commits intoemilk:mainfrom
rustbasic:patch150

Conversation

@rustbasic
Copy link
Copy Markdown
Contributor

@rustbasic rustbasic commented Nov 24, 2024

Add some Keys :

CapsLock,
NumLock,
ScrollLock,

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

@github-actions
Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@rustbasic
Copy link
Copy Markdown
Contributor Author

While it might not work well on the web because the browser takes focus, this isn't the issue with this commit.
We'll need an additional commit for the modifiers.

@Ripper53
Copy link
Copy Markdown

Ripper53 commented Apr 2, 2026

I would really benefit from this feature. I am currently trying to create a key remapping application, and need access to the precise physical keys that are pressed, ie. LeftShift, RightShift, LeftControl, RightControl, LeftAlt, RightAlt. Right now, I just map any shift key onto the left shift. I do not need browser support for my application, only Windows as of now.

An update on this works progression and if it is still being worked on would be appreciated.

@rustbasic
Copy link
Copy Markdown
Contributor Author

@Ripper53

This PR was drafted by emilk and will not be progressed further.
Please use this PR as a reference and modify egui directly for your use.
It would be a good idea for you to refer to this PR and try creating a new, improved PR yourself.

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

4 participants