From: David Mark on
On Jul 27, 4:25 pm, David Mark <dmark.cins...(a)gmail.com> wrote:
> On Jul 27, 1:52 am, David Mark <dmark.cins...(a)gmail.com> wrote:
>
>
>
>
>
> > On Jul 27, 1:31 am, Adam Harvey <use...(a)adamharvey.name> wrote:
>
> > > On Sun, 25 Jul 2010 22:08:43 -0700, David Mark wrote:
> > > > Looks good to me at this point, having tested numerous browsers released
> > > > this century (and one released in the last).  Of course, I only have a
> > > > US keyboard and at the moment cannot test on a Mac (and have never been
> > > > able to test on Unix of any sort).  I know there are lots of variations
> > > > and can't imagine that my logic handles them all. At this point I am
> > > > open to observations and the inevitable workarounds.  But I'm sure as
> > > > hell not using any browser sniffing.  :)
>
> > > Not that I think there'll be an awful lot of value in trying to handle a
> > > lot of this, since it's decidedly unusual, but for the record, here are
> > > some results on Ubuntu Linux 10.04. I have a Sun Type 7 keyboard, which
> > > has some extra keys over and above a normal PC keyboard.
>
> > Okay.
>
> > > First, Chrome 6.0.472.0 dev (the current development release):
>
> > I'd really prefer to stick to general release versions, but no
> > matter.  :)
>
> > > All additional keys (Stop, Again, Copy, Paste, et cetera) return key code
> > > 0:
>
> > Yes, I think we saw a bit of this in previous follow-ups.  Clearly
> > those are useless for browser scripting.
>
> > > Key down at test1: 0
> > > Key up at test1: 0 duration: 47
>
> > > Others work pretty much per other operating systems. Holding down right
> > > arrow, for example:
>
> > > Key down at test1: 39
> > > Key down at test1: 39
> > > Key down at test1: 39
> > > Key down at test1: 39
> > > Key down at test1: 39
> > > Key down at test1: 39
> > > Key down at test1: 39
> > > Key down at test1: 39
> > > Key down at test1: 39
> > > Key down at test1: 39
> > > Key down at test1: 39
> > > Key down at test1: 39
> > > Key up at test1: 39 duration: 867
>
> > > Shortcut key (Control-X, in this case):
>
> > > Key down at test1: 17
> > > Key down at test1: 88
> > > Shortcut character at test1: "X"
> > > Key up at test1: 88 duration: 48
> > > Key up at test1: 17 duration: 120
>
> > Fair enough.
>
> > > One interesting case: I have a compose key [0] on the keyboard. (I find
> > > it useful enough that I tend to bind right-alt to compose on my PC
> > > keyboards as well, but this one happens to be actually labelled compose.)
>
> > I've heard of that, but have never owned such a keyboard.
>
> > > Using it to enter, say é requires three key presses: Compose; '; e. That
> > > looks like this:
>
> > > Key down at test1: 229
> > > Key down at test1: 229
> > > Key up at test1: 0 duration: undefined
> > > Key up at test1: 222 duration: undefined
> > > Key down at test1: 69
> > > Character at test1: "é" (233)
>
> > Well, at least the character came through unscathed.  :)
>
> > > Key up at test1: 69 duration: 61
>
> > > The same tests, on Firefox 3.6.8:
>
> > > Extra keys behave the same:
>
> > > Key down at test1: 0
> > > Key up at test1: 0 duration: 38
>
> > Good to be consistent.
>
> > > Holding right arrow results in slightly different log output:
>
> > > Key down at test1: 39
> > > Autorepeat model: press
> > > Key down at test1: 39
> > > Key down at test1: 39
> > > Key down at test1: 39
> > > Key down at test1: 39
> > > Key down at test1: 39
> > > Key down at test1: 39
> > > Key down at test1: 39
> > > Key up at test1: 39 duration: 750
>
> > Perfect!  The extra log entry indicates that specific type of auto-
> > repeat behavior for control keys has been detected.  That's the one I
> > have always seen in FF on Windows.
>
> Update, actually "both" is what I'm used to see in FF on Windows.
> Opera on Windows is the one with the "press" model.  Wouldn't shock me
> if there is a cross-platform deviation there.  As long as the auto-
> repeated control keys work, all is well.  :)
>
> Just fixed the one issue noted in the document (backspace auto-repeat
> in IE).  Re-testing and will update shortly...

Posted.
From: David Mark on
On Jul 26, 8:19 pm, SAM <stephanemoriaux.NoAd...(a)wanadoo.fr.invalid>
wrote:
> Le 7/27/10 12:43 AM, David Mark a écrit :
>
> <http://www.cinsoft.net/keyboard.html>
>
> I don't know what could be a "Control Keys Auto-repeat"
>
> The "log" is to far down, can't we get it on right side ?
> (column tests and demos - column for logs)
>
> I'll not test functions keys as they are reserved for the system and for
> applications.
>
> > On Jul 26, 9:53 am, SAM <stephanemoriaux.NoAd...(a)wanadoo.fr.invalid>
> > wrote:
> >> other "named keys" ...
> >> Ctrl, Option, Apple :
>
> >> Key down at test4: 17
> >> Key up at test4: 17 duration: 176
> >> Key down at test4: 18
> >> Key up at test4: 18 duration: 112
> >> Key down at test4: 224
> >> Key up at test4: 224 duration: 104
>
> > All look good.
>
> it seems to me that there are "special" keys detections for those keys
>
> alpha Enter key = num Enter key = 13
>
> Control and Alt keys : right and left are the same
> (as Command/Apple key)
>
> >> Key [$*¥€] :
>
> >> Key down at test4: 0
> >> Character at test4: "$" (36)
> >> Key up at test4: 0 duration: 152
>
> > That doesn't.  :(  You typed a total of four characters, right?
>
> On Apple AZERTY French keyboard for France with num pad
> (Canada, Belgium, Swiss, I don't know)
> See png here :
> <http://cjoint.com/data/hBcqmsGpzg_french-fr-apple-keyboard_.png>
>
> It's a key with alternatively 4 characters
>         normal press : $
>         Alt(or Option) + $ = €
>         Shift + $ = *
>         Alt + Shift + $ = ¥

Ah, that explains it.

>
> >> Key [@£`]:
>
> >> Key down at test4: 0
> >> Key up at test4: 0 duration: 168
>
> > What is wrong with your keyboard?  :)
>
> Mystère et boule de gomme ;-)
>
> key : `
> Shift + ` = £
> Shift + Alt + ` = #
>
> >> Key [@#] :
>
> Key @ (on left side of numbers keys on alpha keyboard part)
>
> >> Key down at test4: 0
> >> Character at test4: "@" (64)
>
> Shift + @ = #
>
> >> Key down at test4: 16
> >> Key down at test4: 0
> >> Character at test4: "#" (35)
> >> Key up at test4: 0 duration: 217
> >> Key up at test4: 16 duration: 1680
>
> > What browser/OS?  Mac if I recall?
>
> Firefox.3 on French Mac (system 10.4.11)
>
> > Thanks a lot for your help, SAM!
>
> Test 4 :
> <http://cjoint.com/?hBclIG2m7M>
> <http://cjoint.com/data/hBclIG2m7M_french-fr-apple-keyboard-test2.htm>

Wow. Thanks a lot! Will dig through those in a moment. :)
From: David Mark on
On Jul 26, 8:19 pm, SAM <stephanemoriaux.NoAd...(a)wanadoo.fr.invalid>
wrote:
> Le 7/27/10 12:43 AM, David Mark a écrit :
>
> <http://www.cinsoft.net/keyboard.html>
>
> I don't know what could be a "Control Keys Auto-repeat"
>
> The "log" is to far down, can't we get it on right side ?
> (column tests and demos - column for logs)
>
> I'll not test functions keys as they are reserved for the system and for
> applications.
>
> > On Jul 26, 9:53 am, SAM <stephanemoriaux.NoAd...(a)wanadoo.fr.invalid>
> > wrote:
> >> other "named keys" ...
> >> Ctrl, Option, Apple :
>
> >> Key down at test4: 17
> >> Key up at test4: 17 duration: 176
> >> Key down at test4: 18
> >> Key up at test4: 18 duration: 112
> >> Key down at test4: 224
> >> Key up at test4: 224 duration: 104
>
> > All look good.
>
> it seems to me that there are "special" keys detections for those keys
>
> alpha Enter key = num Enter key = 13
>
> Control and Alt keys : right and left are the same
> (as Command/Apple key)
>
> >> Key [$*¥€] :
>
> >> Key down at test4: 0
> >> Character at test4: "$" (36)
> >> Key up at test4: 0 duration: 152
>
> > That doesn't.  :(  You typed a total of four characters, right?
>
> On Apple AZERTY French keyboard for France with num pad
> (Canada, Belgium, Swiss, I don't know)
> See png here :
> <http://cjoint.com/data/hBcqmsGpzg_french-fr-apple-keyboard_.png>
>
> It's a key with alternatively 4 characters
>         normal press : $
>         Alt(or Option) + $ = €
>         Shift + $ = *
>         Alt + Shift + $ = ¥
>
> >> Key [@£`]:
>
> >> Key down at test4: 0
> >> Key up at test4: 0 duration: 168
>
> > What is wrong with your keyboard?  :)
>
> Mystère et boule de gomme ;-)
>
> key : `
> Shift + ` = £
> Shift + Alt + ` = #
>
> >> Key [@#] :
>
> Key @ (on left side of numbers keys on alpha keyboard part)
>
> >> Key down at test4: 0
> >> Character at test4: "@" (64)
>
> Shift + @ = #
>
> >> Key down at test4: 16
> >> Key down at test4: 0
> >> Character at test4: "#" (35)
> >> Key up at test4: 0 duration: 217
> >> Key up at test4: 16 duration: 1680
>
> > What browser/OS?  Mac if I recall?
>
> Firefox.3 on French Mac (system 10.4.11)
>
> > Thanks a lot for your help, SAM!
>
> Test 4 :
> <http://cjoint.com/?hBclIG2m7M>
> <http://cjoint.com/data/hBclIG2m7M_french-fr-apple-keyboard-test2.htm>
>

At a glance, they look good. You have those odd (0) keydown/keyup's
on some of the more esoteric characters (esoteric for me I mean, they
may well be common in French). But the characters are what's
important and appear to be getting through unscathed.

Thanks again!
From: SAM on
Le 7/27/10 11:07 PM, David Mark a �crit :
> On Jul 26, 8:19 pm, SAM <stephanemoriaux.NoAd...(a)wanadoo.fr.invalid>
> wrote:
>> Le 7/27/10 12:43 AM, David Mark a �crit :
>>
>> <http://www.cinsoft.net/keyboard.html>
(...)
Test on Mac (French France keyboard)
>> Test 4 :
>> <http://cjoint.com/data/hBclIG2m7M_french-fr-apple-keyboard-test2.htm>
that file will autodestroy itself in few days (3 weeks)

> At a glance, they look good. You have those odd (0) keydown/keyup's
> on some of the more esoteric characters (esoteric for me I mean, they
> may well be common in French).

Keys (keyCode==0) : @ $ � ` <
or associated with Shift maintained (pressed) : # * � � >

Key @ : keyCode --> 0 charCode --> 64 character --> @

> But the characters are what's
> important and appear to be getting through unscathed.

Indeed, if not ... how to get them from a keyboard to another one ?

Meta (Apple) : 224 (left & right) evt.metaKey --> true
Control : 17 (left & right) evt.ctrlKey --> true
Alt (Option) : 18 (left & right) evt.altKey --> true
Shift : 16 (left & right) evt.shiftKey --> true

evt.keyCode
Tab : 9
Enter : 13 (alpha & num)
Backspace : 8
Arrows :
left : 37
up : 38
right : 39
down : 40

F1 : 112 and increasing up to F8
F9 to F12 and F14 to F16 : no keyCode (reserved for system)
F13 : 44

--
sm
From: David Mark on
On Jul 27, 4:58 pm, David Mark <dmark.cins...(a)gmail.com> wrote:
> On Jul 27, 4:25 pm, David Mark <dmark.cins...(a)gmail.com> wrote:
>
>
>
>
>
> > On Jul 27, 1:52 am, David Mark <dmark.cins...(a)gmail.com> wrote:
>
> > > On Jul 27, 1:31 am, Adam Harvey <use...(a)adamharvey.name> wrote:
>
> > > > On Sun, 25 Jul 2010 22:08:43 -0700, David Mark wrote:
> > > > > Looks good to me at this point, having tested numerous browsers released
> > > > > this century (and one released in the last).  Of course, I only have a
> > > > > US keyboard and at the moment cannot test on a Mac (and have never been
> > > > > able to test on Unix of any sort).  I know there are lots of variations
> > > > > and can't imagine that my logic handles them all. At this point I am
> > > > > open to observations and the inevitable workarounds.  But I'm sure as
> > > > > hell not using any browser sniffing.  :)
>
> > > > Not that I think there'll be an awful lot of value in trying to handle a
> > > > lot of this, since it's decidedly unusual, but for the record, here are
> > > > some results on Ubuntu Linux 10.04. I have a Sun Type 7 keyboard, which
> > > > has some extra keys over and above a normal PC keyboard.
>
> > > Okay.
>
> > > > First, Chrome 6.0.472.0 dev (the current development release):
>
> > > I'd really prefer to stick to general release versions, but no
> > > matter.  :)
>
> > > > All additional keys (Stop, Again, Copy, Paste, et cetera) return key code
> > > > 0:
>
> > > Yes, I think we saw a bit of this in previous follow-ups.  Clearly
> > > those are useless for browser scripting.
>
> > > > Key down at test1: 0
> > > > Key up at test1: 0 duration: 47
>
> > > > Others work pretty much per other operating systems. Holding down right
> > > > arrow, for example:
>
> > > > Key down at test1: 39
> > > > Key down at test1: 39
> > > > Key down at test1: 39
> > > > Key down at test1: 39
> > > > Key down at test1: 39
> > > > Key down at test1: 39
> > > > Key down at test1: 39
> > > > Key down at test1: 39
> > > > Key down at test1: 39
> > > > Key down at test1: 39
> > > > Key down at test1: 39
> > > > Key down at test1: 39
> > > > Key up at test1: 39 duration: 867
>
> > > > Shortcut key (Control-X, in this case):
>
> > > > Key down at test1: 17
> > > > Key down at test1: 88
> > > > Shortcut character at test1: "X"
> > > > Key up at test1: 88 duration: 48
> > > > Key up at test1: 17 duration: 120
>
> > > Fair enough.
>
> > > > One interesting case: I have a compose key [0] on the keyboard. (I find
> > > > it useful enough that I tend to bind right-alt to compose on my PC
> > > > keyboards as well, but this one happens to be actually labelled compose.)
>
> > > I've heard of that, but have never owned such a keyboard.
>
> > > > Using it to enter, say é requires three key presses: Compose; '; e. That
> > > > looks like this:
>
> > > > Key down at test1: 229
> > > > Key down at test1: 229
> > > > Key up at test1: 0 duration: undefined
> > > > Key up at test1: 222 duration: undefined
> > > > Key down at test1: 69
> > > > Character at test1: "é" (233)
>
> > > Well, at least the character came through unscathed.  :)
>
> > > > Key up at test1: 69 duration: 61
>
> > > > The same tests, on Firefox 3.6.8:
>
> > > > Extra keys behave the same:
>
> > > > Key down at test1: 0
> > > > Key up at test1: 0 duration: 38
>
> > > Good to be consistent.
>
> > > > Holding right arrow results in slightly different log output:
>
> > > > Key down at test1: 39
> > > > Autorepeat model: press
> > > > Key down at test1: 39
> > > > Key down at test1: 39
> > > > Key down at test1: 39
> > > > Key down at test1: 39
> > > > Key down at test1: 39
> > > > Key down at test1: 39
> > > > Key down at test1: 39
> > > > Key up at test1: 39 duration: 750
>
> > > Perfect!  The extra log entry indicates that specific type of auto-
> > > repeat behavior for control keys has been detected.  That's the one I
> > > have always seen in FF on Windows.
>
> > Update, actually "both" is what I'm used to see in FF on Windows.
> > Opera on Windows is the one with the "press" model.  Wouldn't shock me
> > if there is a cross-platform deviation there.  As long as the auto-
> > repeated control keys work, all is well.  :)
>
> > Just fixed the one issue noted in the document (backspace auto-repeat
> > in IE).  Re-testing and will update shortly...
>
> Posted.

Wrapping up the canned My Library version. Noticed one mistake in the
test page character counter demo. The onkey and onchar arguments were
transposed in the call to attachKeyboardListeners. Wasn't fatal, but
was definitely inefficient. ISTM I had noted at one point that Opera
wasn't updating the count until auto-repeated characters stopped.
That was why.

Won't be a problem in the add-on version as, to keep with the general
style of higher-level My Library code, I consolidated all of the
arguments (save for the element reference) into one options object.

Testing a modified test page for the add-on now. Should update the
Downloads page shortly. This add-on will make writing things like UI
widgets and games very easy. As seen on the recently posted Touch
demo, a minimal build (< 25K) can go a long way. Combined with the
Transform add-on, I think My Library is the only suitable candidate
for mobile development.

And speaking of mobiles devices, next up is the Page Transition add-
on, which I recently used to retrofit my entire site to fit and slide
like a native on newer handhelds. Will post that stuff in the next
few days... This is exciting, isn't it? :)
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6
Prev: trying to do AJAX
Next: how to assign a id as a variable