you might have to resort to a LL keyboard hook and eat the keys or perhaps it can be done via a subclass of the gadget and callback.
Code: Select all
Structure akey
ks.a[256]
EndStructure
Global keyhook, keys.akey,listicon
#WH_MOUSE_LL = 14
Procedure.i KeyProc(nCode.i,wParam.i,lParam.i)
Protected *keyInput.KBDLLHOOKSTRUCT
Static pos,len
Protected ret.i, hwnd.i,beat.i
*keyInput = lParam
If nCode = #HC_ACTION
hwnd = GetActiveWindow_()
If hwnd = WindowID(0)
Select wParam
Case #WM_KEYUP
keys\ks[*keyInput\vkCode] = 0
Case #WM_KEYDOWN
keys\ks[*keyInput\vkCode]= $fe
If (GetAsyncKeyState_(#VK_SHIFT) & $8000)
keys\ks[#VK_SHIFT]=$fe
Else
keys\ks[#VK_SHIFT]=0
EndIf
If (GetAsyncKeyState_(#VK_CONTROL) & $8000)
keys\ks[#VK_CONTROL]=$fe
Else
keys\ks[#VK_CONTROL]=0
EndIf
If (GetAsyncKeyState_(#VK_LMENU) & $8000)
keys\ks[#VK_LMENU]=$fe
Else
keys\ks[#VK_LMENU]=0
EndIf
If (GetAsyncKeyState_(#VK_RMENU) & $8000)
keys\ks[#VK_RMENU]=$fe
Else
keys\ks[#VK_RMENU]=0
EndIf
If keys\ks[#VK_SHIFT] And keys\ks[#VK_A] ;<-----------block the keys
Debug "blocked shift + A"
beat = 1
EndIf
EndSelect
EndIf
EndIf
If Not beat
ret = CallNextHookEx_(Keyhook, nCode, wParam, lParam)
Else
ret = 1
EndIf
ProcedureReturn ret
EndProcedure
Procedure SetHooks()
Protected hInstance = GetModuleHandle_(0)
If hInstance
Keyhook = SetWindowsHookEx_(#WH_KEYBOARD_LL, @KeyProc(),hInstance,0)
Else
MessageRequester("hook", "can't get module handle")
EndIf
If (Keyhook = 0)
MessageRequester("hook", "can't get module handle")
EndIf
EndProcedure
Procedure KillHooks()
UnhookWindowsHookEx_(Keyhook)
KeyHook = 0
EndProcedure
If OpenWindow(0, 0, 0, 700, 300, "ListIconGadgets", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
SetHooks()
; left column
TextGadget (6, 10, 10, 330, 20, "ListIcon Standard", #PB_Text_Center)
ListIconGadget(0, 10, 25, 330, 70, "Column 1", 100)
TextGadget (7, 10, 105, 330, 20, "ListIcon with Checkbox", #PB_Text_Center)
ListIconGadget(1, 10, 120, 330, 70, "Column 1", 100, #PB_ListIcon_CheckBoxes) ; ListIcon with checkbox
TextGadget (8, 10, 200, 330, 20, "ListIcon with Multi-Selection", #PB_Text_Center)
ListIconGadget(2, 10, 215, 330, 70, "Column 1", 100, #PB_ListIcon_MultiSelect) ; ListIcon with multi-selection
; right column
TextGadget (9, 360, 10, 330, 20, "ListIcon with separator lines",#PB_Text_Center)
ListIconGadget(3, 360, 25, 330, 70, "Column 1", 100, #PB_ListIcon_GridLines)
TextGadget (10, 360, 105, 330, 20, "ListIcon with FullRowSelect and AlwaysShowSelection",#PB_Text_Center)
ListIconGadget(4, 360, 120, 330, 70, "Column 1", 100, #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection)
TextGadget (11, 360, 200, 330, 20, "ListIcon Standard with large icons",#PB_Text_Center)
ListIconGadget(5, 360, 220, 330, 65, "", 200,#PB_ListIcon_GridLines)
For a = 0 To 4 ; add columns to each of the first 5 listicons
For b = 2 To 4 ; add 3 more columns to each listicon
AddGadgetColumn(a, b, "Column " + Str(b), 65)
Next
For b = 0 To 2 ; add 4 items to each line of the listicons
AddGadgetItem(a, b, "Item 1"+Chr(10)+"Item 2"+Chr(10)+"Item 3"+Chr(10)+"Item 4")
Next
Next
; Here we change the ListIcon display to large icons and show an image
If LoadImage(0, #PB_Compiler_Home+"examples/sources/Data/File.bmp") ; change path/filename to your own 32x32 pixel image
SetGadgetAttribute(5, #PB_ListIcon_DisplayMode, #PB_ListIcon_LargeIcon)
AddGadgetItem(5, 0, "Picture 1", ImageID(0))
AddGadgetItem(5, 1, "Picture 2", ImageID(0))
EndIf
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
KillHooks()