User forums > General (but related to Code::Blocks)

show debugger tip under curser when ctrl key is pressed

<< < (2/8) > >>

eranif:

--- Quote from: ollydbg ---Can we use the evt.GetKey???

--- End quote ---
I think you misunderstood me...

What I meant is:
When the CONTROL key is DOWN you will not receive the wxEVT_SCI_DWELLSTART event. (this is on Windows 7 with the latest wxScintilla)

If you *do* receive the event, then I suggest that you try:


--- Code: ---if(wxGetMouseState().ControlDown())
--- End code ---

Eran

ollydbg:

--- Quote from: eranif on December 17, 2010, 10:44:06 am ---
--- Quote from: ollydbg ---Can we use the evt.GetKey???

--- End quote ---
I think you misunderstood me...

What I meant is:
When the CONTROL key is DOWN you will not receive the wxEVT_SCI_DWELLSTART event. (this is on Windows 7 with the latest wxScintilla)

--- End quote ---

thanks, I understand now.


--- Quote from: eranif on December 17, 2010, 10:44:06 am ---If you *do* receive the event, then I suggest that you try:


--- Code: ---if(wxGetMouseState().ControlDown())
--- End code ---

Eran

--- End quote ---
In fact, I never get such event when I press the control key.  :D ,may be, we can hack the scintilla code.

ollydbg:
@eranif and other devs
from the scintilla maillist, I get the answers, see below:
https://groups.google.com/forum/?fromgroups#!forum/scintilla-interest

--- Quote ---AsmWarrior:

> I would like to receive the dwell( call tip ) event when I hold on the ctrl
> key. currently, In Windows OS, when I hold the ctrl key, the dwel event will
> never sent. but it seems under linux, it works.

   On Windows, keeping the Ctrl key pressed causes multiple key press
events to occur just like holding down an arrow key causes multiple
movements. Each time a key press event occurs, Scintilla resets the
dwell timer as normal key presses are interpreted as the user doing
something and not just hovering the mouse.

   You could try to filter out these key press events, possibly on the
basis of which key is being pressed or on whether its an auto-repeat.

   Neil
--- End quote ---

So, I will try to find the code snippet where the "multiply key" event occurs, and filter out such key.

BTW: can someone familiar with scintilla core base can give me a point? thanks.

ollydbg:

--- Code: ---Index: plugins/debuggergdb/debuggergdb.cpp
===================================================================
--- plugins/debuggergdb/debuggergdb.cpp (revision 6903)
+++ plugins/debuggergdb/debuggergdb.cpp (working copy)
@@ -2648,6 +2648,11 @@
     if (!Manager::Get()->GetConfigManager(_T("debugger"))->ReadBool(_T("eval_tooltip"), false))
         return;
 
+    if (!::wxGetKeyState(WXK_CONTROL))  // does not work!!!!!
+        return;
+    //if(! (::GetAsyncKeyState(VK_CONTROL)&0x80))
+    //    return;
+
     EditorBase* base = event.GetEditor();
     cbEditor* ed = base && base->IsBuiltinEditor() ? static_cast<cbEditor*>(base) : 0;
     if (!ed)
Index: sdk/wxscintilla/src/scintilla/src/Editor.cxx
===================================================================
--- sdk/wxscintilla/src/scintilla/src/Editor.cxx (revision 6903)
+++ sdk/wxscintilla/src/scintilla/src/Editor.cxx (working copy)
@@ -5379,7 +5379,10 @@
 }
 
 int Editor::KeyDown(int key, bool shift, bool ctrl, bool alt, bool *consumed) {
- DwellEnd(false);
+
+ if (!ctrl)
+     DwellEnd(false);
+
  int modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) |
          (alt ? SCI_ALT : 0);
  int msg = kmap.Find(key, modifiers);


--- End code ---

This patch try to solve the problem, but it failed. when holding the ctrl, the tip show about 0.1 second and disappeared quickly.

any one can help me? thanks.

Jenna:
Works here on windows7.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version