|
|
||||
|
||||
|
|
|
|||
|
Hi Fatfat
My solution is just an approximation to what should be done; sometimes work fine, sometimes not. * function clearkeys() // clears keyboard buffer and mouse clicks (but not always) *----------------- local wSetTypeAhead := set(_SET_TYPEAHEAD, 0) __Keyboard( 0 ) __Keyboard() __Keyboard( 0 ) while nextkey() # 0 ; inkey(0.01) ; end set(_SET_TYPEAHEAD, wSetTypeAhead) return nil The thing is: apparently, xharbour has two buffers, one for the keyboard and another for the mouse (I think because it needs the position x,y where the pointer is), and they are used in different context or ways. Regards, -- --- Lic. Claudio VOSKIAN Phone/Fax: (+54 11) 4988-0114 Mobile: (+54 911) 4435-4789 Aol/Msn/Skype/Y!: cvoskian - icq#: 18122595 "fatfat" escribió en el mensaje de noticias:jkcc6c$5s8$1@dont-email.me... Hi all, my program is using mouse click for the console program but the click keycode is left behind that affect other coding is there any clear process like clear typeahead that clear mouse event also ? Thanks |
|
|||
|
find a way
inkey(0,127) ---> clear and wait for all mouse event inkey(0,128) ---> keyboard event only inkey(0,255) ----> all event (mouse + keyboard) "Claudio Voskian" 在郵件張貼內容主旨 jkchg1$2mn$1@dont-email.me ä¸*撰寫... Hi Fatfat My solution is just an approximation to what should be done; sometimes work fine, sometimes not. * function clearkeys() // clears keyboard buffer and mouse clicks (but not always) *----------------- local wSetTypeAhead := set(_SET_TYPEAHEAD, 0) __Keyboard( 0 ) __Keyboard() __Keyboard( 0 ) while nextkey() # 0 ; inkey(0.01) ; end set(_SET_TYPEAHEAD, wSetTypeAhead) return nil The thing is: apparently, xharbour has two buffers, one for the keyboard and another for the mouse (I think because it needs the position x,y where the pointer is), and they are used in different context or ways. Regards, -- --- Lic. Claudio VOSKIAN Phone/Fax: (+54 11) 4988-0114 Mobile: (+54 911) 4435-4789 Aol/Msn/Skype/Y!: cvoskian - icq#: 18122595 "fatfat" escribió en el mensaje de noticias:jkcc6c$5s8$1@dont-email.me... Hi all, my program is using mouse click for the console program but the click keycode is left behind that affect other coding is there any clear process like clear typeahead that clear mouse event also ? Thanks |
|
|||
|
sorry, still can't solve the problem
try to find a way again :-( "fatfat" 在郵件張貼內容主旨 jkdul8$qka$1@dont-email.me ä¸*撰寫... find a way inkey(0,127) ---> clear and wait for all mouse event inkey(0,128) ---> keyboard event only inkey(0,255) ----> all event (mouse + keyboard) "Claudio Voskian" 在郵件張貼內容主旨 jkchg1$2mn$1@dont-email.me ä¸*撰寫... Hi Fatfat My solution is just an approximation to what should be done; sometimes work fine, sometimes not. * function clearkeys() // clears keyboard buffer and mouse clicks (but not always) *----------------- local wSetTypeAhead := set(_SET_TYPEAHEAD, 0) __Keyboard( 0 ) __Keyboard() __Keyboard( 0 ) while nextkey() # 0 ; inkey(0.01) ; end set(_SET_TYPEAHEAD, wSetTypeAhead) return nil The thing is: apparently, xharbour has two buffers, one for the keyboard and another for the mouse (I think because it needs the position x,y where the pointer is), and they are used in different context or ways. Regards, -- --- Lic. Claudio VOSKIAN Phone/Fax: (+54 11) 4988-0114 Mobile: (+54 911) 4435-4789 Aol/Msn/Skype/Y!: cvoskian - icq#: 18122595 "fatfat" escribió en el mensaje de noticias:jkcc6c$5s8$1@dont-email.me... Hi all, my program is using mouse click for the console program but the click keycode is left behind that affect other coding is there any clear process like clear typeahead that clear mouse event also ? Thanks |
|
|||
|
solved by putting inkey(0,255) before issuing hb_keyput() function
"fatfat" 在郵件張貼內容主旨 jke3d5$f0p$1@dont-email.me ä¸*撰寫... sorry, still can't solve the problem try to find a way again :-( "fatfat" 在郵件張貼內容主旨 jkdul8$qka$1@dont-email.me ä¸*撰寫... find a way inkey(0,127) ---> clear and wait for all mouse event inkey(0,128) ---> keyboard event only inkey(0,255) ----> all event (mouse + keyboard) "Claudio Voskian" 在郵件張貼內容主旨 jkchg1$2mn$1@dont-email.me ä¸*撰寫... Hi Fatfat My solution is just an approximation to what should be done; sometimes work fine, sometimes not. * function clearkeys() // clears keyboard buffer and mouse clicks (but not always) *----------------- local wSetTypeAhead := set(_SET_TYPEAHEAD, 0) __Keyboard( 0 ) __Keyboard() __Keyboard( 0 ) while nextkey() # 0 ; inkey(0.01) ; end set(_SET_TYPEAHEAD, wSetTypeAhead) return nil The thing is: apparently, xharbour has two buffers, one for the keyboard and another for the mouse (I think because it needs the position x,y where the pointer is), and they are used in different context or ways. Regards, -- --- Lic. Claudio VOSKIAN Phone/Fax: (+54 11) 4988-0114 Mobile: (+54 911) 4435-4789 Aol/Msn/Skype/Y!: cvoskian - icq#: 18122595 "fatfat" escribió en el mensaje de noticias:jkcc6c$5s8$1@dont-email.me... Hi all, my program is using mouse click for the console program but the click keycode is left behind that affect other coding is there any clear process like clear typeahead that clear mouse event also ? Thanks |
|
|||
|
Fatfat
Using your findings, it turns out to be this piece fo code that is working -almost- fine right now: * function clear_keys() *------------------------ while nextkey(INKEY_ALL) # 0 inkey(0.01, INKEY_ALL) end return nil I don't use hb_keyput(..), why do you use it? Wish to know if someone else is having the same problem like you or me (a way to clear the mouse clicks and the keyboard keys from the internal buffer). Best regards, Claudio "fatfat" escribió en el mensaje de noticias:jktvj2$7le$1@dont-email.me... solved by putting inkey(0,255) before issuing hb_keyput() function "fatfat" 在郵件張貼內容主à ¦â€”¨ jke3d5$f0p$1@dont-email.me ä¸Â*撰寫... sorry, still can't solve the problem try to find a way again :-( "fatfat" 在郵件張貼內容主à ¦â€”¨ jkdul8$qka$1@dont-email.me ä¸Â*撰寫... find a way inkey(0,127) ---> clear and wait for all mouse event inkey(0,128) ---> keyboard event only inkey(0,255) ----> all event (mouse + keyboard) "Claudio Voskian" 在郵件張貼內容主à ¦â€”¨ jkchg1$2mn$1@dont-email.me ä¸Â*撰寫... Hi Fatfat My solution is just an approximation to what should be done; sometimes work fine, sometimes not. * function clearkeys() // clears keyboard buffer and mouse clicks (but not always) *----------------- local wSetTypeAhead := set(_SET_TYPEAHEAD, 0) __Keyboard( 0 ) __Keyboard() __Keyboard( 0 ) while nextkey() # 0 ; inkey(0.01) ; end set(_SET_TYPEAHEAD, wSetTypeAhead) return nil The thing is: apparently, xharbour has two buffers, one for the keyboard and another for the mouse (I think because it needs the position x,y where the pointer is), and they are used in different context or ways. Regards, -- --- Lic. Claudio VOSKIAN Phone/Fax: (+54 11) 4988-0114 Mobile: (+54 911) 4435-4789 Aol/Msn/Skype/Y!: cvoskian - icq#: 18122595 "fatfat" escribió en el mensaje de noticias:jkcc6c$5s8$1@dont-email.me... Hi all, my program is using mouse click for the console program but the click keycode is left behind that affect other coding is there any clear process like clear typeahead that clear mouse event also ? Thanks |
|
|||
|
I add the mouse click checking at the bottom line which display the funtion
key and put the related function key "Claudio Voskian" 在郵件張貼內容主旨 jl0e09$dq1$1@dont-email.me ä¸*撰寫... Fatfat Using your findings, it turns out to be this piece fo code that is working -almost- fine right now: * function clear_keys() *------------------------ while nextkey(INKEY_ALL) # 0 inkey(0.01, INKEY_ALL) end return nil I don't use hb_keyput(..), why do you use it? Wish to know if someone else is having the same problem like you or me (a way to clear the mouse clicks and the keyboard keys from the internal buffer). Best regards, Claudio "fatfat" escribió en el mensaje de noticias:jktvj2$7le$1@dont-email.me... solved by putting inkey(0,255) before issuing hb_keyput() function "fatfat" 在郵件張貼內容主à ¦â€”¨ jke3d5$f0p$1@dont-email.me ä¸Â*撰寫... sorry, still can't solve the problem try to find a way again :-( "fatfat" 在郵件張貼內容主à ¦â€”¨ jkdul8$qka$1@dont-email.me ä¸Â*撰寫... find a way inkey(0,127) ---> clear and wait for all mouse event inkey(0,128) ---> keyboard event only inkey(0,255) ----> all event (mouse + keyboard) "Claudio Voskian" 在郵件張貼內容主à ¦â€”¨ jkchg1$2mn$1@dont-email.me ä¸Â*撰寫... Hi Fatfat My solution is just an approximation to what should be done; sometimes work fine, sometimes not. * function clearkeys() // clears keyboard buffer and mouse clicks (but not always) *----------------- local wSetTypeAhead := set(_SET_TYPEAHEAD, 0) __Keyboard( 0 ) __Keyboard() __Keyboard( 0 ) while nextkey() # 0 ; inkey(0.01) ; end set(_SET_TYPEAHEAD, wSetTypeAhead) return nil The thing is: apparently, xharbour has two buffers, one for the keyboard and another for the mouse (I think because it needs the position x,y where the pointer is), and they are used in different context or ways. Regards, -- --- Lic. Claudio VOSKIAN Phone/Fax: (+54 11) 4988-0114 Mobile: (+54 911) 4435-4789 Aol/Msn/Skype/Y!: cvoskian - icq#: 18122595 "fatfat" escribió en el mensaje de noticias:jkcc6c$5s8$1@dont-email.me... Hi all, my program is using mouse click for the console program but the click keycode is left behind that affect other coding is there any clear process like clear typeahead that clear mouse event also ? Thanks |
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|