F1... key on windows

F1... key on windows

Post by swan le » Wed, 10 Jan 2007 15:51:51


hi all,
with the following script,
on macintosh, i can press F1 F2 F3 F4 button in the same time, and the
concerned button will go to blue
on windows, when i press F1 F2 F3 F4, i cannot have all the button
colored. only 2 contiguous button will be colored.

i'm using 8.4.14 version and XP.

can someone test this piece of code and give me the reason of this
behaviour
many thanks,
best regards

package require Tk

for {set x 1} {$x<= 10} {incr x} {
pack [button .b$x -text B$x] -side left
if {[tk windowingsystem] eq "win32"} {
bind . <KeyPress-F$x> "[list .b$x configure -bg blue] ; break"
bind . <KeyRelease-F$x> "[list .b$x configure -bg white] ; break"
}
if {[tk windowingsystem] eq "aqua"} {
bind . <KeyPress-F$x> [list .b$x configure -highlightbackground blue]
bind . <KeyRelease-F$x> [list .b$x configure -highlightbackground
white]
}
}
 
 
 

F1... key on windows

Post by Gerald W. » Wed, 10 Jan 2007 22:38:14


Microsoft wrote the window and keyboard manager.



--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+

 
 
 

F1... key on windows

Post by Bryan Oakl » Wed, 10 Jan 2007 23:47:37


I can test the piece of code but I can't give a reason for the behavior.
It appears to be a shortcoming of Windows XP. I get the same behavior
you witness, namely that you can't press F1, F2, F3 and F4
simultaneously and have all four recognized.

Do you have an app where you need to be able to process simultaneous
keypresses of multiple function keys? That seems like an odd feature
(unless you are emulating something such as a piano keyboard)
 
 
 

F1... key on windows

Post by Darren Ne » Thu, 11 Jan 2007 01:31:52


It's usually a shortcoming of a cheap keyboard that is wired in such a
way as to be unable to recognise more than two keypresses at the same
time, due to "wired-or" logic in the hardware.

--
Darren New / San Diego, CA, USA (PST)
Scruffitarianism - Where T-shirt, jeans,
and a three-day beard are "Sunday Best."
 
 
 

F1... key on windows

Post by Melissa Sc » Thu, 11 Jan 2007 10:05:17

In article < XXXX@XXXXX.COM >,



It's probably the keyboard, not Windows. You'll get different results
with different keyboard designs: only so many simultaneous keypresses
are registered because of the circuitry.

For example, I have an Apple Extended Keyboard II (on a USB-ADB
converter), and I can generate F1-F6 simultaneously, but only F7 and F8
simultaneously. I've never personally cracked one open, but I suspect
that, to keep the keyboard controller cheap, the keys register as a
combination of multiple contacts closing. The more contacts used to
define a single key, the fewer you can press simultaneously and still
register a new keypress.

--
MKS
 
 
 

F1... key on windows

Post by swan le » Thu, 11 Jan 2007 17:46:46

>> hi all,

the fact is i've got a cheap keyboard and i can hear that it's faulty,
but i've tested the same code on a recent laptop, and the same problem
occur.
 
 
 

F1... key on windows

Post by swan le » Thu, 11 Jan 2007 17:47:47

>> hi all,

the fact is i've got a cheap keyboard and i can hear that it's faulty,
but i've tested the same code on a recent laptop, and the same problem
occur.
 
 
 

F1... key on windows

Post by Gerald W. » Thu, 11 Jan 2007 22:56:29


So, a lot of manufactures take the same shortcut because normal MS Windows
programs do not deal with multiple keys (other than the modifier keys of
control, shift, and alt) being pressed at the same time.

--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+
 
 
 

F1... key on windows

Post by Darren Ne » Fri, 12 Jan 2007 01:44:01


It's not a question of "faulty". It's a question of design.


And what makes you think the laptop isn't using the same design?

Here's an easier example. Look at a telephone touch-tone keypad. Many of
these are built with wires going across and wires going down. So
pressing "1" completes the first vertical wire and the first horizontal
wire. Pressing "5" completes the second horizontal and the second
vertical. If you then press "4", that completes the first vertical and
the second horizontal connection. But those connections are already on,
so the rest of the circuitry can't see that keypress.

Many keyboards are built this way, especially as you get more and more
keys. That's why most can only register two simultaneous keypresses. It
usually isn't a problem, because even fast typists usually finish
letting go of the first key before they start pressing the second key.

--
Darren New / San Diego, CA, USA (PST)
Scruffitarianism - Where T-shirt, jeans,
and a three-day beard are "Sunday Best."
 
 
 

F1... key on windows

Post by swan le » Fri, 12 Jan 2007 02:06:25

Darren New a rit :


damned!!!
you should be right because on a text-editor i can type 8 horizontal
keys (<zxcvbnm), but multiple vertical keys does not work.

so finally i vote for apple design ;-)

thanks
nicolas
 
 
 

F1... key on windows

Post by Aric Bill » Fri, 12 Jan 2007 05:54:52

FWIW, when I run your code on Windows XP and ActiveTcl (Wish) 8.4.14, I
can light up up to four buttons simultaneously (depending on how fast I
push the buttons), but no more than four.

Aric
 
 
 

F1... key on windows

Post by Uwe Klei » Fri, 12 Jan 2007 17:31:33


That is called "123../N key rollover"
http://www.yqcomputer.com/ (key)

The Cherry keyboards I use are advertised as "Alpha N key rollover"

There is probably another limit in the keyboard driver of the OS to
distinguish from "your face in the keys" ;-)

uwe
 
 
 

F1... key on windows

Post by swan le » Fri, 12 Jan 2007 18:39:16

Uwe Klein a rit :


thanks for this clear article
 
 
 

F1... key on windows

Post by Melissa Sc » Sat, 13 Jan 2007 09:44:06


Well, I can't vouch for any Apple keyboard made after 1995, but I can
reliably press any three letter/number keys simultaneously, and any four
in a given column or row. Three in a column locks out two or three keys
in the column next to it, but sometimes only one of the keys in columns
on the opposite side of the keyboard. The F-keys seem less reliable in
this manner. Basically, this means whoever designed it, did so
sensibly. For a QWERTY keyboard and English keep you alternating
between the left-hand and right-hand quite often, but you almost never
have to depress multiple F-keys simultaneously.

There's a reason I like these older keyboards, even if they do weigh
more than a Mac Mini. Now, if only they made a Model M with an
open-apple key. :-)

--
MKS