开发者

Mouse cursor disaappears on keypress event in Jquery

开发者 https://www.devze.com 2023-03-23 22:44 出处:网络
I 开发者_StackOverflow社区am using arrow keys to move an object in my code. Everything works fine except that the mouse cursor disappears when I press any of the arrow keys. How can I make the cursor

I 开发者_StackOverflow社区am using arrow keys to move an object in my code. Everything works fine except that the mouse cursor disappears when I press any of the arrow keys. How can I make the cursor stay visible? I am using this code check for arrow keys pressed.

$(document).ready(function() {  
    $(document).keydown(function(event) {
        checkKeys(event);
    }).keyup(function(event) {
        keyUp(event);
    });  
});


That's browser behavior (maybe even OS behavior!), you probably won't find a way to stop it with javascript.

It's intended to hide the cursor so you can see what you're typing. Try it on any website, keystrokes always make the mouse cursor go away.

0

精彩评论

暂无评论...
验证码 换一张
取 消