Discussion:
How to tell Scintilla to not consume keys
Charly Dante
2014-01-06 12:26:43 UTC
Permalink
Hi,

I'm currently working on an application that uses the scintilla control and I wounder how to tell scintilla not to consume all keys pressed by the user?

I would like to link a function declaration with its definition, so that when the user holds down the CTRL-key and clicks on a function, it jumps automatically to the declaration of that function.

However, I can't catch any Keyboard messages at all. I already tried SCN_KEY, but nothing happens, no matter which key is pressed.

I also tried to catch the key event directly in my application like that:


LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_KEYDOWN:
std::cout << "The user pressed a key!\n";
break;
}
return DefWindowProc(hwnd, msg, wParam, lParam);
}

But again, nothing happens. It seems that the Scintilla Control is consuming all keystrokes - how can I solve this problem?

Best,
CD
--
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 scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Neil Hodgson
2014-01-06 22:14:21 UTC
Permalink
Post by Charly Dante
However, I can't catch any Keyboard messages at all.
Using Win32, the application receives all keyboard messages and is responsible for forwarding them to Scintilla. Examine the way SciTE implements ModelessHandler in its EventLoop method to see how it handles keys.
Post by Charly Dante
I already tried SCN_KEY, but nothing happens, no matter which key is pressed.
SCN_KEY was only implemented for GTK+, not Win32.
Post by Charly Dante
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
You can subclass Scintilla if you want to do it like this. For an example of subclassing Scintilla on Win32 see SciTE's CreditsWndProc for its About box.

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 scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Charly Dante
2014-01-07 10:20:39 UTC
Permalink
Hi,

thank you very much for the quick response, I will take a look at the SciTE
CreditWndProc then.
Sorry for posting two threads with the same topic btw, I thought my first
thread was lost while I just had to wait to become member of this group.

CD
--
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 scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Loading...