HighDots Forums  

keyboard events and dead letters

Javascript JavaScript language (comp.lang.javascript)


Discuss keyboard events and dead letters in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Joaquín Zuazo
 
Posts: n/a

Default Re: keyboard events and dead letters - 05-20-2008 , 05:15 AM






On 20 mayo, 11:53, Thomas 'PointedEars' Lahn <PointedE... (AT) web (DOT) de>
wrote:
Quote:
[snipped attribution novel]

Joaquín Zuazo wrote:
Thomas 'PointedEars' Lahn wrote:
Joaquín Zuazo wrote:
[103 quoted lines]


"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.12) Gecko/20080129
Iceweasel/2.0.0.12 (Debian-2.0.0.12-0etch1)":

| keydown keyCode=68 (D) which=68 (D) charCode=0
keyIdentifier=undefined
| keypress keyCode=0 which=100 (d) charCode=100 (d)
keyIdentifier=undefined
| keyup keyCode=68 (D) which=68 (D) charCode=0
keyIdentifier=undefined

So probably it's a bug in the Firefox version of your Linux distribution.

I guess from your message, that you are pressing the key "d". This
works well with my distribution,
and with the same result you are posting.

The problem comes when I need to identify an "á" or an "ö". For that,
I must press two keys, one for
the accent ( the dead key ) and other for the letter itself with an
spanish keyboard, or an english international
keyboard, that provides dead letters also.

Then, only two keyup events are returned for all the keys pressed.

With windows, you get five keyboard events, and all the information
you need to identify
the key.
Thanks a lot for your help.


Reply With Quote
  #12  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: keyboard events and dead letters - 05-20-2008 , 05:40 AM






JoaquÃ*n Zuazo wrote:
Quote:
Thomas 'PointedEars' Lahn wrote:
[snipped attribution novel]
JoaquÃ*n Zuazo wrote:
Thomas 'PointedEars' Lahn wrote:
JoaquÃ*n Zuazo wrote:
[103 quoted lines]

"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.12) Gecko/20080129
Iceweasel/2.0.0.12 (Debian-2.0.0.12-0etch1)":

| keydown keyCode=68 (D) which=68 (D) charCode=0
keyIdentifier=undefined
| keypress keyCode=0 which=100 (d) charCode=100 (d)
keyIdentifier=undefined
| keyup keyCode=68 (D) which=68 (D) charCode=0
keyIdentifier=undefined

So probably it's a bug in the Firefox version of your Linux distribution.

I guess from your message, that you are pressing the key "d". This
works well with my distribution, and with the same result you are posting.

The problem comes when I need to identify an "á" or an "ö". For that,
I must press two keys, one for the accent ( the dead key ) and other
for the letter itself with an spanish keyboard, or an english international
keyboard, that provides dead letters also.
Sorry, I missed that this time.

Quote:
Then, only two keyup events are returned for all the keys pressed.
I am afraid I have to confirm this (with only "keypress" suppressed):

Quote:
keyup keyCode=0 which=0 charCode=0
keyIdentifier=undefined
ókeyup keyCode=79 (O) which=79 (O) charCode=0
keyIdentifier=undefined

Quote:
With windows, you get five keyboard events, and all the information
you need to identify the key.
Yes, indeed (same character, same settings):

Quote:
keydown keyCode=221 which=221 charCode=0
keyIdentifier=undefined
keyup keyCode=221 which=221 charCode=0
keyIdentifier=undefined
keydown keyCode=79 (O) which=79 (O) charCode=0
keyIdentifier=undefined
keypress keyCode=0 which=243 charCode=243
keyIdentifier=undefined
keyup keyCode=79 (O) which=79 (O) charCode=0
keyIdentifier=undefined

So ISTM for Linux you have to watch for a keyup event for a character key
immediately preceded by a keyup event where keyCode == which == 0.
Unfortunately, `charCode' is not available then, and ISTM keyCode/which
is specific to a keyboard layout. But maybe it suffices here.


PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>


Reply With Quote
  #13  
Old   
Joaquín Zuazo
 
Posts: n/a

Default Re: keyboard events and dead letters - 05-20-2008 , 06:32 AM




Quote:
So ISTM for Linux you have to watch for a keyup event for a character key
immediately preceded by a keyup event where keyCode == which == 0.
Unfortunately, `charCode' is not available then, and ISTM keyCode/which
is specific to a keyboard layout. But maybe it suffices here.

The problem is than you can not know even what kind of accent was
pressed.
The only place where you can get the information is within the input
box
value.

I think this is a bug of Firefox.


Reply With Quote
  #14  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: keyboard events and dead letters - 05-20-2008 , 08:13 AM



JoaquÃ*n Zuazo wrote:
Quote:
So ISTM for Linux you have to watch for a keyup event for a character key
immediately preceded by a keyup event where keyCode == which == 0.
Unfortunately, `charCode' is not available then, and ISTM keyCode/which
is specific to a keyboard layout. But maybe it suffices here.

The problem is than you can not know even what kind of accent was
pressed. The only place where you can get the information is within
the input box value.
Right. So that would mean evaluation after input, using .selectionStart and
..selectionEnd. Not pretty, but works.

Quote:
I think this is a bug of Firefox.
Or of X? Yes, you should file a bug.


PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f806at$ail$1$8300dec7 (AT) news (DOT) demon.co.uk>


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.