Post

Replies

Boosts

Views

Activity

Comment on How to capture the currently pressed key when a TextField is in focus?
Thanks, this works really well. I am able to intercept single key presses as well as keypress with modifiers! However, this doesn't help me with detecting modifier-only key presses. For eg, nothing gets printed when I press only the Alt key. I ask this because the nature of my application allows the user to experience additional functionality on press of special keys - pressing the Alt key at a particular screen may trigger a particular menu. How do I intercept such keypresses?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’25