Re: Re: custom keybindings (AltGr)
Matthew Flatt <mflatt-sDh8Nw2yj/[email protected]>
| Newsgroups | gmane.comp.lang.racket.user,gmane.lisp.scheme.plt |
|---|---|
| Message-ID | <[email protected]> |
Thanks for looking into this problem in depth! Although I'll suggest an alternate implementation, your patch was helpful for me to understand the problems and goals. To generate an event when AltGr-<x> doesn't produce a character, I think a better approach here is to call ToUnicode(). That seems to work as a check for whether a meaning is assigned to a key combination. It avoids using state to try to match key-up events with key-down events, and it should work better with key repeats. For making Ctl-Alt-<x> work as AltGr-<x>, I think I see what you want, based on how programs like Notepad interpret key combinations. I think other users will still want to distinguish Ctl-Alt-<x> and AltGr-<x> for keyboard shortcuts, though, along the same lines that Emacs distinguishes them. So we'll probably need to make that an option, similar to the `special-option-key` setting for OS X. Can you try the enclosed "key.rkt" to see whether it works the way you want? This version defines `control+alt-always-as-altgr?` as #t to simulate an option for making Ctl-Alt-<x> work as AltGr-<x>. At Mon, 7 Mar 2016 15:16:23 +0000, Bert De Ketelaere wrote: > Hello, > > > after looking around trying to fix my previous > problem<https://groups.google.com/d/topic/racket-users/_1i-zcfBaaM/discussion> > I found that DrRacket really is not sending any event for AltGr+(Key x) > combinations if this combination doesn't actually produces a char. > > I tried changing the win32/key.rkt file in gui-lib so DrRacket would get these > events and en passant I tried to make DrRacket behave more like other Win > programs when it comes to keyboard input. > > > my attempt is at: > > https://github.com/bdeket/gui/commit/994a5655a9f913b7388e0c74c1b6203659b645d3 > > > A few problems remain: > > Ctrl+Alt+(key x): where this combination doesn't produce a char, x is produced > instead of nothing > > Ctrl+Alt+(key x) or AltGr+(key x): the release event is now hijacked and sends > another keypress-event. > > This is a problem, but I don't know how to fix this, and I prefer this > over the previous state where key-events where ignored > > > Unfortunately I didn't understand all the code that was already there, and I > didn't find standard tests to test this. > > Are there tests for the key-events? > > > Kind regards, > > Bert > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected] > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected] For more options, visit https://groups.google.com/d/optout.
key.rkt
(application/octet-stream, 14.4 KB) - not displayed