Summary: | [GTK] Enter on buttons doesn't work | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Marco Barisione <marco.barisione> | ||||
Component: | WebKitGTK | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | alp, ap | ||||
Priority: | P3 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | PC | ||||||
OS: | OS X 10.5 | ||||||
Attachments: |
|
Description
Marco Barisione
2008-04-08 02:55:03 PDT
Created attachment 20402 [details]
Set the text of the event to '\r' when the return/enter key is pressed
Note that I used '\r' instead of '\n' because it's what WebCore use. Probably it's better to use '\n' modifying WebCore to allow this, but I think there could be a lot of places in WebCore where the code assumes that enter is '\r'. What do you think?
(In reply to comment #1) > Created an attachment (id=20402) [edit] > Set the text of the event to '\r' when the return/enter key is pressed > > Note that I used '\r' instead of '\n' because it's what WebCore use. Probably > it's better to use '\n' modifying WebCore to allow this, but I think there > could be a lot of places in WebCore where the code assumes that enter is '\r'. > What do you think? > Yeah. While this fix looks like it'll work I think it'd be great to investigate if this can be fixed better in WebCore. Marco: It's up to you. I can land this patch if you're willing to follow it up with a proper fix (if necessary), or I can leave it out till we get a better idea of how to proceed. It might be worth talking with ap (Alexey) about this one, he has a good eye for input issues. Comment on attachment 20402 [details]
Set the text of the event to '\r' when the return/enter key is pressed
It's surprising that gdk_keyval_to_unicode doesn't handle these keys - what is the story behind this? I couldn't find any hints in documentation. Are there any other keys that need to be special cased?
Yes, it is correct to use \r here - JavaScript code on the Web expects to see 0x13 in keypress.charCode, so this is not just internal to WebCore.
I have noticed that windowsKeyCodeForKeyEvent doesn't handle GDK_ISO_Enter and GDK_KP_Enter - this looks worth fixing, too.
r=me
(In reply to comment #3) > It's surprising that gdk_keyval_to_unicode doesn't handle these keys - what is > the story behind this? I couldn't find any hints in documentation. Are there > any other keys that need to be special cased? I don't know (I will ping someone on IRC about this) but probably it would return \n not \r, so we would need to special case it even if gdk was changed. Alp, can you commit the patch? > I have noticed that windowsKeyCodeForKeyEvent doesn't handle GDK_ISO_Enter and > GDK_KP_Enter - this looks worth fixing, too. Opened another bug on this (bug #18576). |