Bug Tracker

Opened 8 years ago

Closed 8 years ago

#9689 closed bug (invalid)

keypress

Reported by: alexander.petrichkovich@… Owned by: alexander.petrichkovich@…
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.

Change History (5)

comment:1 Changed 8 years ago by Rick Waldron

Component: unfiledevent
Owner: set to alexander.petrichkovich@…
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/

comment:2 Changed 8 years ago by anonymous

Sorry, <body onkeypress="key(event)">. I use Google Chrome 12.0.742.100 and FF5.

comment:3 Changed 8 years ago by anonymous

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?

comment:5 Changed 8 years ago by ajpiano

Resolution: invalid
Status: pendingclosed
Note: See TracTickets for help on using tickets.