Re: Detecting Escape key
Jean Lalonde <[email protected]> Sun, 10 Nov 2024 09:08:59 -0800 (PST)
| Newsgroups | gmane.comp.lib.scintilla.devel |
|---|---|
| Message-ID | <[email protected]> |
> Another approach is to check for keystrokes in the application's message loop. Yes, that would be the solution. But your suggestion made me think that the Esc key has a use in the Scintilla editor (when doing multiple selections). So I decided to change the "Close window" key in my app from Esc to Ctrl+F4 instead. This is why I don't need to detect the Esc key anymore. > It depends on the context of this Scintilla control within your application. If its a part of the application main window (like the editing pane in SciTE) then you should include a binding for the escape key in the accelerator table, commonly configured in a resource (.rc) file. There is no such .rc file in the dev platform I use (AutoHotkey). There would probably be another approach but as mentioned before, I won't need it for now. This being said, I may need your help again for some feature like styling and lexer for which the learning curve seems rather steep to me... Thank you Neil. Jean Le samedi 9 novembre 2024 à 16 h 52 min 48 s UTC-5, Neil Hodgson a écrit : > Jean Lalonde: > > > I'm new to coding the Scintilla control. I had "some" success using an > AutoHotkey wrapper to pass commands to the Scintilla DLL but I still have a > lot to learn and understand... > > > > How can I detect the user hit the Escape key? My goal to is to hide the > editor window when user hit Escape. > > It depends on the context of this Scintilla control within your > application. If its a part of the application main window (like the editing > pane in SciTE) then you should include a binding for the escape key in the > accelerator table, commonly configured in a resource (.rc) file. If it's in > a dialog then it should close by default but there are some potential > issues with WM_GETDLGCODE that may need to be addressed. Another approach > is to check for keystrokes in the application's message loop. > > Neil -- You received this message because you are subscribed to the Google Groups "scintilla-interest" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/scintilla-interest/715eb0bd-233c-4301-883a-a5eff8c57c27n%40googlegroups.com.