[SOLVED] How to catch mouse left click with GOScintilla

Just starting out? Need help? Post your questions and find answers here.
Maitre_Kanter
User
User
Posts: 84
Joined: Mon Sep 06, 2010 3:05 pm

[SOLVED] How to catch mouse left click with GOScintilla

Post by Maitre_Kanter »

Hello,

another question about scintilla and I can't catch mouse leftclick event using the Scintilla callback.

I searched on scintilla documentation and google but nothing relevant for me.

Windows 10 64bits, Purebasic 5.72, GoScintilla 3.0.1

Thank you,

Kanter
Last edited by Maitre_Kanter on Sat Apr 18, 2020 9:06 pm, edited 1 time in total.
wombats
Enthusiast
Enthusiast
Posts: 716
Joined: Thu Dec 29, 2011 5:03 pm

Re: How to catch mouse left click with Scintilla (GOSCIntill

Post by wombats »

I don't know if this would interfere with anything Scintilla does internally, but this works (Windows only):

Code: Select all

InitScintilla()

Global oldScintillaProc

Procedure.i ScintillaProc(hWnd, uMsg, wParam, lParam)
  Protected Result
  Select uMsg
    Case #WM_LBUTTONDOWN
      Debug "Left button down"
  EndSelect
  ProcedureReturn CallWindowProc_(oldScintillaProc, hWnd, uMsg, wParam, lParam)
EndProcedure

If OpenWindow(0, 0, 0, 320, 240, "ScintillaGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  ScintillaGadget(0, 0, 0, 320, 240, 0)
  oldScintillaProc = SetWindowLong_(GadgetID(0), #GWL_WNDPROC, @ScintillaProc())
EndIf

Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
Maitre_Kanter
User
User
Posts: 84
Joined: Mon Sep 06, 2010 3:05 pm

Re: How to catch mouse left click with Scintilla (GOSCIntill

Post by Maitre_Kanter »

Thank you wombats,

it is working but the goal of the functionality is to click on a line and analyze this line. #WM_LBUTTONDOWN event is posted before Scintilla selects the line.

This is why I just modified the event #WM_LBUTTONDOWN to #WM_LBUTTONUP

Kanter
Post Reply