detect how a button was pressed in javascript -



detect how a button was pressed in javascript -

is there way observe how button pressed?

mouse clicked //mouse event highlighted via tab come in key //keypress event touched (mobile phones) //touch event

is there short javascript way observe this? or need add together event listeners click, enter, , touch? want info form submits. thanks

this how can handle

highlighted via tab come in key //keypress event

$('a').click(function(e) { console.log(e); // screen positions returns 0 on come in if( e.screenx == 0 && e.screeny == 0 ) { alert('enter'); } else if( e.type == "click" ) { alert('click'); } });

demo ofcause rest observe easily.

javascript

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -