Closed Bug 1214965 Opened 9 years ago Closed 9 years ago

test_bug1137557.html should test .location value of Numpad keys

Categories

(Core :: DOM: Device Interfaces, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: masayuki, Assigned: timdream)

References

Details

(Keywords: inputmethod)

Attachments

(1 file, 2 obsolete files)

The location of following code values should be KeyboardEvent.DOM_KEY_LOCATION_NUMPAD. We should include such test.

> 'Numpad0'
> 'Numpad1'
> 'Numpad2'
> 'Numpad3'
> 'Numpad4'
> 'Numpad5'
> 'Numpad6'
> 'Numpad7'
> 'Numpad8'
> 'Numpad9'
> 'NumpadAdd'
> 'NumpadBackspace'
> 'NumpadClear'
> 'NumpadClearEntry'
> 'NumpadComma'
> 'NumpadDecimal'
> 'NumpadDivide'
> 'NumpadEnter'
> 'NumpadEqual'
> 'NumpadHash'
> 'NumpadMemoryAdd'
> 'NumpadMemoryClear'
> 'NumpadMemoryRecall'
> 'NumpadMemoryStore'
> 'NumpadMemorySubtract'
> 'NumpadMultiply'
> 'NumpadParenLeft'
> 'NumpadParenRight'
> 'NumpadStar' (we've not supported this yet, though)
> 'NumpadSubtract'


(And also the location of left or right modifier keys too?)
Assignee: nobody → timdream
Status: NEW → ASSIGNED
Masayuki, could you tell me what's the expected |key| values of these |code| values? I am trying to follow

http://www.w3.org/TR/DOM-Level-3-Events-code/#key-numpad-section

but I some of them don't have any useful descriptions.

> 'NumpadClear'

'Clear'?

> 'NumpadClearEntry'

'Clear'?

> 'NumpadMemoryAdd'
> 'NumpadMemoryClear'
> 'NumpadMemoryRecall'
> 'NumpadMemoryStore'
> 'NumpadMemorySubtract'

?

If they don't come with usual key values I will simply set it to '?', indicating the key outputs a question mark character.

Thanks.
Flags: needinfo?(masayuki)
I think that there are no de facto standards of those keys. So, I think that the default value should be 'Unidentified'.
Flags: needinfo?(masayuki)
Attached patch bug1214965.patch (obsolete) (deleted) — Splinter Review
It turned out NumpadHash is not supported yet either. It's not referenced anywhere in Gecko.

https://dxr.mozilla.org/mozilla-central/search?q=NumpadHash&redirect=false&case=true

Masayuki, please tell me if this fits the expectation of this bug. Thanks.

https://treeherder.mozilla.org/#/jobs?repo=try&revision=0271110a5dd7
Attachment #8677898 - Flags: review?(masayuki)
Comment on attachment 8677898 [details] [diff] [review]
bug1214965.patch

>+  [['+', 'NumpadAdd'],
>+   [',', 'NumpadComma'],
>+   ['.', 'NumpadDecimal'],
>+   ['.', 'NumpadComma'],  // Locale-specific NumpadComma
>+   [',', 'NumpadDecimal'],  // Locale-specific NumpadDecimal

Could you add ['', 'NumpadComma'] case? At least on Windows, comma key on Numpad inputs a character only with some keyboard layout (e.g., Brazilian). If we will support hardware keyboard in IME, the case might be necessary.

>+   ['/', 'NumpadDivide'],
>+   ['=', 'NumpadEqual'],
>+   // ['#', 'NumpadHash'], // Not supported yet.

Indeed.

>+   ['*', 'NumpadMultiply'],
>+   ['(', 'NumpadParenLeft'],
>+   [')', 'NumpadParenRight'],
>+   // ['*', 'NumpadStar'], // Not supported yet.

Ah, yes. But this will be necessary for supporting simple phone. (The key is '*' of the simple phone.) So, please test this.


Thank you for your work!!
Attachment #8677898 - Flags: review?(masayuki) → review+
(In reply to Masayuki Nakano (:masayuki) (Mozilla Japan) from comment #5)
> >+   // ['*', 'NumpadStar'], // Not supported yet.
> 
> Ah, yes. But this will be necessary for supporting simple phone. (The key is
> '*' of the simple phone.) So, please test this.

Could you clarify how I should test this?

navigator.mozInputMethod.sendKey({key: '*', code: 'NumpadStar'}); will simply throw because Gecko does not currently recognize "NumpadStar".
Flags: needinfo?(masayuki)
(In reply to Tim Guan-tin Chien [:timdream] (please needinfo) from comment #6)
> (In reply to Masayuki Nakano (:masayuki) (Mozilla Japan) from comment #5)
> > >+   // ['*', 'NumpadStar'], // Not supported yet.
> > 
> > Ah, yes. But this will be necessary for supporting simple phone. (The key is
> > '*' of the simple phone.) So, please test this.
> 
> Could you clarify how I should test this?
> 
> navigator.mozInputMethod.sendKey({key: '*', code: 'NumpadStar'}); will
> simply throw because Gecko does not currently recognize "NumpadStar".

Ah, right. We've not implemented it yet, sorry. I'll cancel the comment out at implementing the code value.
Flags: needinfo?(masayuki)
Attached patch bug1214965.patch (obsolete) (deleted) — Splinter Review
['', 'NumpadComma'] added.
Attachment #8677898 - Attachment is obsolete: true
Attachment #8678725 - Flags: review+
sorry backed out for test failures like https://treeherder.mozilla.org/logviewer.html#?job_id=16238994&repo=mozilla-inbound
Flags: needinfo?(timdream)
Attached patch bug1214965.patch (deleted) — Splinter Review
I didn't not address the review comment correctly. I did try it locally ... probably overlooked the error :'( sorry about that.
Attachment #8678725 - Attachment is obsolete: true
Flags: needinfo?(timdream)
Attachment #8679225 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/ec5247a32592
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: