-1
每次(有或没有CTRL按),我得到相同的日志; control is not pressed
。有人可以解释是什么原因。JavaScript或Jquery事件处理程序的“ctrl”+更改
$("Selector").on("change",function(e){
if(e.ctrlKey){
console.log("ctrl is pressed");
}
else{
console.log("ctrl is not pressed");
}
});
你还是应该检查比释放的键是Ctrl键之一:'.keyup(功能(E){ 如果(e.which === 17)ctrlKeyHeld = FALSE; })' –