Skip to main content

Bug Tracker

Side navigation

#9689 closed bug (invalid)

Opened June 28, 2011 08:44PM UTC

Closed June 28, 2011 11:28PM UTC

keypress

Reported by: alexander.petrichkovich@gmail.com Owned by: alexander.petrichkovich@gmail.com
Priority: undecided Milestone: 1.next
Component: event Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:
Description

$(document.body)

.bind('keypress', function(event) {

console.log(event);

});

and

$(document.body)

.keypress(function(event) {

console.log(event);

});

don't work.

Only <body onkeypressed="..."> works correctly.

Attachments (0)
Change History (5)

Changed June 28, 2011 08:47PM UTC by rwaldron comment:1

component: unfiledevent
owner: → alexander.petrichkovich@gmail.com
status: newpending

onkeypressed is not a valid key event name.

Which browser are you experiencing this issue in? This works for me:

http://jsfiddle.net/rwaldron/WXMca/

Changed June 28, 2011 09:20PM UTC by anonymous comment:2

Sorry, <body onkeypress="key(event)">.

I use Google Chrome 12.0.742.100 and FF5.

Changed June 28, 2011 10:21PM UTC by anonymous comment:3

Fixed my code in this way:

$(document).keypress(function(event) {

if (event.ctrlKey) {

//ctrl+c

if (event.charCode == 99) {

But have a problem with 'ctrl+c' in Google Chrome.

Can you tell me is it possible to get 'ctrl+c' work in Google Chrome?

Changed June 28, 2011 11:00PM UTC by anonymous comment:4

Changed June 28, 2011 11:28PM UTC by ajpiano comment:5

resolution: → invalid
status: pendingclosed