Keys
Posted: Fri Aug 26, 2005 1:39 am
If i am in a editor gadget, how can i disable a keys? Like backspace. Could i have an example.
Thanks so much!
Thanks so much!

Code: Select all
Enumeration
#Window_Main
#Gadget_Editor
EndEnumeration
WindowWidth = 640
WindowHeight = 480
If OpenWindow(#Window_Main, 0, 0, WindowWidth, WindowHeight, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered, "MyWindow")
AddKeyboardShortcut(#Window_Main, #PB_Shortcut_Escape, #PB_Shortcut_Escape)
AddKeyboardShortcut(#Window_Main, #PB_Shortcut_Delete, #PB_Shortcut_Delete)
If CreateGadgetList(WindowID(#Window_Main))
EditorGadget(#Gadget_Editor, 10, 10, 620, 460, "")
EndIf
Quit = #False
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Quit = #True
Case #PB_Event_Menu
Select EventMenuID()
Case #PB_Shortcut_Escape
Quit = #True
Case #PB_Shortcut_Delete
MessageRequester("Warning", "Delete key is not usable here")
EndSelect
EndSelect
Until Quit
EndIf
End