Detect a keypress in an editor gadget
Posted: Mon Mar 17, 2025 11:20 pm
How do you detect a keypress inside an editor? Or how do you detect that the text inside the editor has changed? Preferably something cross platform.
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
Procedure FillList()
SetWindowTitle(0, " [" + Len(GetGadgetText(11)) + " ch] ")
EndProcedure
OpenWindow(0, 30, 30, 600, 400, "Demo1", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget)
EditorGadget(11, 2, 2, 555, 355)
BindGadgetEvent(11,@FillList(),#PB_EventType_Change )
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
Code: Select all
EventType() = #PB_EventType_Change