Re: [racket-users] Racket GUI editor: how read and process keyboard input

2020-12-06 Thread Matthew Flatt
Although key events from `racket/gui` cannot report the press of Caps Lock as an independent event, each key event reports whether Caps Lock is currently on, which I think is relevant here. For example, using (define mainTextArea (new (class text% (define/override (o

Re: [racket-users] Racket GUI editor: how read and process keyboard input

2020-12-06 Thread Sorawee Porncharoenwase
IIRC, capslock can’t be handled by applications. When people customize capslock to do something else, what they actually do is to ask their OS to redirect the capslock keypress to other keys (say, F2), and then intercept these other keys instead. To catch keypresses like F2, create your own class

[racket-users] Racket GUI editor: how read and process keyboard input

2020-12-06 Thread Christian Lykke
I would like to create an editor where I can use capslock or some other key to input special commands somewhat similar to M-x in emacs. with capslock (since I never use capslock anyway): every time I write someting in the editor, a function should run that will do something with the input. If c