Go Back   Rhinocerus > Newsgroup > Newsgroup comp.lang.* 1 > Newsgroup comp.lang.xharbour

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 03-21-2012, 09:57 AM
fatfat
Guest
 
Posts: n/a
Default How to clear mouse click event ?

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

Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 03-21-2012, 11:27 AM
Claudio Voskian
Guest
 
Posts: n/a
Default Re: How to clear mouse click event ?

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

Reply With Quote
  #3 (permalink)  
Old 03-22-2012, 12:18 AM
fatfat
Guest
 
Posts: n/a
Default Re: How to clear mouse click event ?

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

Reply With Quote
  #4 (permalink)  
Old 03-22-2012, 01:39 AM
fatfat
Guest
 
Posts: n/a
Default Re: How to clear mouse click event ?

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

Reply With Quote
  #5 (permalink)  
Old 03-28-2012, 03:12 AM
fatfat
Guest
 
Posts: n/a
Default Re: How to clear mouse click event ?

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

Reply With Quote
  #6 (permalink)  
Old 03-29-2012, 01:30 AM
Claudio Voskian
Guest
 
Posts: n/a
Default Re: How to clear mouse click event ?

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

Reply With Quote
  #7 (permalink)  
Old 03-29-2012, 02:09 PM
fatfat
Guest
 
Posts: n/a
Default Re: How to clear mouse click event ?

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

Reply With Quote
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 07:57 PM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.