SoFunction
Updated on 2025-04-10

JS sample code for blocking key effects and changing key effects

Function keys F1-F2:112-123

a-b:65-90

Number keys: 0-9: 48-57

ESC:27

Backspace: 8

Enter: 13

shift:16;Ctrl:17;Alt:18

Space: 32

Insert:45;Delete:46

Copy the codeThe code is as follows:

function (){                                                             �
  if(==13)
  {
   ("loginbtn").click();  
   return false;                              
  }
 }

 

=MM_KeyPress;

function  MM_KeyPress(num){
//Prevent the system backspace key
 var keycode = ;
if(keycode ==8)//Block backspace
 {

  = 0;
  //=false;
  return;
 }
if(keycode >=112 && keycode <=123)//Mask f1-12 function keys
 {

  = 0 ;
  =false;
  return;
 }
}