Home > Mobile >  Js to monitor mobile terminal keyboard click, great spirit action
Js to monitor mobile terminal keyboard click, great spirit action

Time:10-04

Now I h5 project has a search interface, , product manager for button is cancelled, users click on the keyboard to confirm key submit search, our android and ios can be monitored phone keyboard ok button to submit a search, but didn't find the can monitor the h5, asked the great spirit action

CodePudding user response:

Set a form, in the form of form submitted to try

CodePudding user response:

reference 1st floor daijinhua response:
set a form, in the form of a form submission try

I have set a form, the key is in, click on the keyboard when the search button to submit this form, now won't solve is to monitor mobile search key keyboard

CodePudding user response:

The problem is solved now?

CodePudding user response:

The $(document). Keydown (function (event) {
//alert (event. KeyCode);
//to determine when the event. The keyCode for 37 (left side key), executive function to_left ();
//judgment when event. The keyCode for 39 (that is, the right side key), executive function to_right ();
If (event. The keyCode==13) {
//alert (" enter ");
}
});

CodePudding user response:

This problem solved

CodePudding user response:

I also encountered this problem, the building Lord solved?

CodePudding user response:

6th floor can see print keyCode bai, then in a similar way to 4th floor to detect whether press,

-- -- -- -- -- -- -- -- -- -- -- --
$(' # TXT) on (' keypress '(evt)=& gt; {//# TXT is a text input
Alert (evt. KeyCode);
});
-- -- -- -- -- -- -- -- -- -- -- --

CodePudding user response:

Testing to determine the key code
  • Related