I can't catch the 3+4+5. I do any combination of two, i.e. 3+4, 3+5 and 4+5, but not all three of them.
Please try the next demo
CLEAR
PUBLIC ofrm
ofrm = CREATEOBJECT("myform")
ofrm.show()
DEFINE CLASS myform as form
Autocenter = .T.
l3 = .F. && .T. while 3 is down
(pressed)
l4 = .F. && .T. while 4 is down
(pressed)
l5 = .F. && .T. while 5 is down
(pressed)
ADD OBJECT txt1 as textbox
ADD OBJECT cmd as commandbutton
WITH top = 50
PROCEDURE init
UNBINDEVENTS(This.hwnd)
BINDEVENT(This.hwnd,0x0100,This,"detectkeydown")
BINDEVENT(This.hwnd,0x0101,This,"detectkeyup")
ENDPROC
PROCEDURE detectkeydown
LPARAMETERS p1,p2,p3,p4
* p3 = Virtual-key code
IF p3 = 0x33 && 3 is pressed
This.l3 = .T.
ENDIF
IF p3 = 0x34 && 4 is
pressed
This.l4 = .T.
ENDIF
IF p3 = 0x35 && 5 is
pressed
This.l5 = .T.
ENDIF
IF This.l3 AND This.l4 AND This.l5
ACTIVATE SCREEN
? 'Bingo!'
? 'An 3+4+5 occures'
ENDIF
ACTIVATE SCREEN
?This.l3 ,This.l4 ,This.l5
ENDPROC
PROCEDURE detectkeyup
LPARAMETERS p1,p2,p3,p4
* p3 = Virtual-key code
IF p3 = 0x33 && 3 is released
This.l3 = .F.
ENDIF
IF p3 = 0x34 && 4 is
released
This.l4 = .F.
ENDIF
IF p3 = 0x35 && 5 is
released
This.l5 = .F.
ENDIF
ENDPROC
ENDDEFINE
CLEAR
PUBLIC ofrm
ofrm = CREATEOBJECT("myform")
ofrm.show()
DEFINE CLASS myform as form
Autocenter = .T.
l3 = .F. && .T. while 3 is down
(pressed)
l4 = .F. && .T. while 4 is down
(pressed)
l5 = .F. && .T. while 5 is down
(pressed)
ADD OBJECT txt1 as textbox
ADD OBJECT cmd as commandbutton WITH
top =
50
PROCEDURE init
UNBINDEVENTS(This.hwnd)
BINDEVENT(This.hwnd,0x0100,This,"detectkeydown")
BINDEVENT(This.hwnd,0x0101,This,"detectkeyup")
ENDPROC
PROCEDURE detectkeydown
LPARAMETERS p1,p2,p3,p4
* p3 = Virtual-key code
IF p3 = 0x63 && 3 is pressed
This.l3 = .T.
ENDIF
IF p3 = 0x64 && 4 is
pressed
This.l4 = .T.
ENDIF
IF p3 = 0x65 && 5 is
pressed
This.l5 = .T.
ENDIF
IF This.l3 AND This.l4 AND This.l5
ACTIVATE SCREEN
? 'Bingo!'
? 'An 3+4+5 occures'
ENDIF
ACTIVATE SCREEN
?This.l3 ,This.l4 ,This.l5
ENDPROC
PROCEDURE detectkeyup
LPARAMETERS p1,p2,p3,p4
* p3 = Virtual-key code
IF p3 = 0x63 && 3 is released
This.l3 = .F.
ENDIF
IF p3 = 0x64 && 4 is
released
This.l4 = .F.
ENDIF
IF p3 = 0x65 && 5 is
released
This.l5 = .F.
ENDIF
ENDPROC
ENDDEFINE
Related posts
http://praisachion.blogspot.com/2017/08/easter-eggs-4.html
http://praisachion.blogspot.com/2017/08/easter-eggs-3.html
http://praisachion.blogspot.com/2017/08/easter-eggs-2.html
http://praisachion.blogspot.com/2017/08/easter-eggs-1.html
http://praisachion.blogspot.com/2016/02/interceptin-ctrlshiftenter.html
http://praisachion.blogspot.com/2015/06/detect-keyup-like-mouseup.html
http://praisachion.blogspot.com/2015/01/how-can-i-prevent-undocking-docked-form.html
http://praisachion.blogspot.com/2017/08/easter-eggs-4.html
http://praisachion.blogspot.com/2017/08/easter-eggs-3.html
http://praisachion.blogspot.com/2017/08/easter-eggs-2.html
http://praisachion.blogspot.com/2017/08/easter-eggs-1.html
http://praisachion.blogspot.com/2016/02/interceptin-ctrlshiftenter.html
http://praisachion.blogspot.com/2015/06/detect-keyup-like-mouseup.html
http://praisachion.blogspot.com/2015/01/how-can-i-prevent-undocking-docked-form.html
Niciun comentariu:
Trimiteți un comentariu