Bob Fludder
Posts: 0
Joined: Fri Sep 14, 2012 1:09 am

keydown event

I am trying to find if the enter key has been pressed. I can see the various key... events but how then do i get the keyCode ?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

keydown event

Hello! I'm not sure I understand your question. Could you clarify please?

Bob Fludder
Posts: 0
Joined: Fri Sep 14, 2012 1:09 am

keydown event

Did you get my email ? Anyway what I'm trying to achieve is to see if someone has pressed the enter key and if so then run the same procedure as if they had clicked on a button

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

keydown event

You can use event.which that includes code of pressed button.
enter key keycode is equal to 13

Bob Fludder
Posts: 0
Joined: Fri Sep 14, 2012 1:09 am

keydown event

I tried event.which and firebug says event is not defined. You have to forgive me I can barely spell javascript..

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

keydown event

Such events probably only available when running in desktop browser. I don't think they are available in a mobile browser (as there is no keyboard).

Bob Fludder
Posts: 0
Joined: Fri Sep 14, 2012 1:09 am

keydown event

Hi. Just finished testing a solution (for me at least). I ended up defining a new event on page load and linked it to the component. Seems to work fine so far.
This is my code (for now at least):

Tiggzi("password").keydown(function(event){
alert("Key: " + event.which);
};

Bob Fludder
Posts: 0
Joined: Fri Sep 14, 2012 1:09 am

keydown event

oops. Minor mistake - missing a ).

Tiggzi("password").keydown(function(event){
alert("Key: " + event.which);
});

Shahrukh Badar5891231
Posts: 0
Joined: Sun May 26, 2013 6:39 pm

keydown event

your function helps me alot.
thanks

Emmz
Posts: 0
Joined: Sat Jun 23, 2012 11:06 pm

keydown event

True Marina. There are no keycodes on Android and the like

Return to “Issues”