The only method I've been able to come up with to trap the paste is via an addkeyboardshortcut command. But I seem to get multiple 'hits' to the menu routine and see no easy, foolproof method to just do my routine once per control/v.
(In my experience, trapping vk_control and VK_V still lets the paste occur).
Is there some easier way to accomplish what would seem to be a fairly simple action?
Code: Select all
Procedure ctlV()
If GetAsyncKeyState_(#VK_CONTROL)
If GetAsyncKeyState_(#VK_V)
Debug "Do My Thing ONCE"
EndIf
EndIf
EndProcedure
If OpenWindow(0, 0, 0, 300, 300, "EditorGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
EditorGadget(0, 8, 8, 250, 250)
AddKeyboardShortcut(0, #PB_Shortcut_Control|#PB_Shortcut_V, 5);without this all pastes work
Repeat
If EventMenu()=5
ctlV()
EndIf
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
End 
