J'ai déjà écrit un bout de soft qui détectait l'appuye sur "Entrée" du clavier, mais j'ai un problème pour retrouver ma routine, y aurait il ici une âme charitable
Détection RC
Détection RC
Bonjour
J'ai déjà écrit un bout de soft qui détectait l'appuye sur "Entrée" du clavier, mais j'ai un problème pour retrouver ma routine, y aurait il ici une âme charitable
Il va de soi que ce n'est pas en mode console !
J'ai déjà écrit un bout de soft qui détectait l'appuye sur "Entrée" du clavier, mais j'ai un problème pour retrouver ma routine, y aurait il ici une âme charitable
Denis
Bonne Jounée à tous
Bonne Jounée à tous
Salut 
J'ai pas ta routine, mais voilà la mienne, si ça peut te dépanner.
Chris 
J'ai pas ta routine, mais voilà la mienne, si ça peut te dépanner.
Code : Tout sélectionner
#Window_0 = 0
#Gadget = 0
If OpenWindow(#Window_0, 200, 100, 200, 200, #PB_Window_SystemMenu | #PB_Window_TitleBar, "New window ( 0 )")
Repeat
Select WindowEvent()
Case #WM_KEYDOWN
Select EventwParam()
Case $D
Debug Str(EventwParam()) + " = Carriage Return" ; Carriage Return
EndSelect
Case #PB_EventCloseWindow : End
EndSelect
ForEver
EndIf
Et voila 
Code : Tout sélectionner
; PureBasic Visual Designer v3.81 build 1321
;- Window Constants
;
Enumeration
#Window_0
EndEnumeration
;- Gadget Constants
;
Enumeration
#Gadget_0
#Gadget_1
EndEnumeration
If OpenWindow(#Window_0, 216, 0, 180, 88, #PB_Window_ScreenCentered | #PB_Window_SystemMenu, "New window ( 0 )")
If CreateGadgetList(WindowID())
StringGadget(#Gadget_1, 20, 50, 150, 30, "")
StringGadget(#Gadget_0, 20, 10, 150, 30, "")
EndIf
AddKeyboardShortcut(0, #PB_Shortcut_Return, 15)
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_Menu
If EventMenuID() = 15
Debug "Enter"
If GetFocus_() = GadgetID(#Gadget_0)
Debug "Enter dans gadget 1"
ElseIf GetFocus_() = GadgetID(#Gadget_1)
Debug "Enter dans gadget 2"
Else
Debug "Enter tout seul"
EndIf
EndIf
EndIf
Until Event = #PB_Event_CloseWindow
EndIf