1. RE: Q

on furthur investigation it seems that both 'F2' and 'q' are returning the
same keycode and shift. Both are 113 and 0. How do I solve this??
george

new topic     » topic index » view message » categorize

2. RE: Q

Hi George,

Key F2 is a special (non-printable) key and is captured through the 
onKeyDown event (also onKeyUp). It has a code of #71 (see w32keys.e) 
which is 113 decimal. Key 'q' is captured through onKeyPress event and 
has an ascii code of..113. At a guess I would say that the problem is 
that there is some overlap occurring with the above key events.

Mike

gwalters at sc.rr.com wrote:
> on furthur investigation it seems that both 'F2' and 'q' are returning 
> the
> same keycode and shift. Both are 113 and 0. How do I solve this??
> george
> 
> 



vulcan at win.co.nz

new topic     » goto parent     » topic index » view message » categorize

3. RE: Q

Perhaps more investigation is in order.

The scan code for F2 is 113 and the scan code for Q is 81.

They are similar if you look at them in binary (one bit difference):
1110001 binary = 113 decimal
1010001 binary = 81 decimal

I don't know if that's much help but...
-- Brian

george wrote:
> on furthur investigation it seems that both 'F2' and 'q' are returning 
> the
> same keycode and shift. Both are 113 and 0. How do I solve this??
> george

new topic     » goto parent     » topic index » view message » categorize

4. RE: Q

113 is the ascii code for 'q'.

316 is the keyboard scan code for F2.

Two different formats.. Or am I mistaken?

wait_key() (which is actually a modified version of get_key() ),
returns the ascii code for displayable keys, for others, like the arrow 
keys, function keys, and home keys, the scan code is returned.


Chris


gwalters at sc.rr.com wrote:
> can someone explain why this program displays 316 for F2 and 113 for 
> 'q'? is
> this a dos vs win32 difference on the representation of keys?
> 
> global constant cr = 13,
>  esc = 27,
>  leftArrow = 331,
>  rightArrow = 333,
>  upArrow = 328,
>  downArrow = 336,
>  insert = 338,
>  home = 327,
>  endkey = 335,
>  pageUp = 329,
>  pageDown = 337,
>  del = 339,
>  tabRight = 9,
>  tabLeft = 9,
>  backDel = 8,
>  f1 = 112,
>  f2 = 113,
>  f3 = 114,
>  f4 = 115,
>  f5 = 116,
>  f6 = 117,
>  f7 = 118,
>  f8 = 119,
>  f9 = 120,
>  f10 = 121,
>  f11 = 122,
>  f12 = 123
> 
> --------------
> include get.e
> atom c
> 
> while 1 do
>  c = wait_key()
>  printf (1,"%d %d\n",c)
>  if c = esc then
>   exit
>  end if
> 
> end while
> 
> george
> ----- Original Message -----
> From: <gwalters at sc.rr.com>
> To: "EUforum" <EUforum at topica.com>
> Sent: Wednesday, February 27, 2002 8:30 AM
> Subject: Re: Q
> 
> 
> > thanks all for the help on 'q'. the problem was in my program where the
> same
> > routine was handeling both interrupts. so...i've split it you and all is
> > working fine now..thanks
> >
> > george
> > ----- Original Message -----
> > From: "Mike" <vulcan at win.co.nz>
> > To: "EUforum" <EUforum at topica.com>
> > Sent: Tuesday, February 26, 2002 2:37 PM
> > Subject: RE: Q
> >
> >
> > > Hi George,
> > >
> > > Key F2 is a special (non-printable) key and is captured through the
> > > onKeyDown event (also onKeyUp). It has a code of #71 (see w32keys.e)
> > > which is 113 decimal. Key 'q' is captured through onKeyPress event and
> > > has an ascii code of..113. At a guess I would say that the problem is
> > > that there is some overlap occurring with the above key events.
> > >
> > > Mike
> > >
> > > gwalters at sc.rr.com wrote:
> > > > on furthur investigation it seems that both 'F2' and 'q' are returning
> > > > the
> > > > same keycode and shift. Both are 113 and 0. How do I solve this??
> > > > george
> > > >
> > > >
> > > vulcan at win.co.nz
> > >
> > >

new topic     » goto parent     » topic index » view message » categorize

5. RE: Q

gwalters at sc.rr.com wrote:
> can someone explain why this program displays 316 for F2
> and 113 for 'q'?

Because those are the specific codes for those keys. Your constants 
don't affect this particular program, so you could remove them and do 
this:

> include get.e
> atom c
> 
> while 1 do
>  c = wait_key()
>  printf (1,"%d %d\n",c)
>  if c = 27 then
>   exit
>  end if
> 
> end while

You'll get the same results.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu