Dans ce code je fais un debug de la touche #VK_CAPITAL qui renvoie 1 si activé ou 0 sinon.
Le problème avec PureBasic 4.40, c'est que l'API fonctionne très bien si la fenêtre à le Focus mais si elle le perd, j'ai n'importe quoi; alors que ça marche très bien avec la 4.31.
Résultat j'ai des codes qui ne fonctionnent plus avec la 4.40
Le code de test:
Code : Tout sélectionner
Global Dim Key.c(256)
Procedure TimerProc(hwnd.l, uMsg.l, idEvent.l, dwTime.l)
Select uMsg
Case #WM_TIMER
Select idEvent
Case 99
GetKeyboardState_(@Key(0))
Debug Key(#VK_CAPITAL)
EndSelect
EndSelect
EndProcedure
OpenWindow(1, 10, 10, 220, 220, "", #PB_Window_SystemMenu)
StickyWindow(1, 1)
SetTimer_(WindowID(1), 99, 2000, @TimerProc())
Repeat
Message=WindowEvent()
Until Message=#WM_CLOSE