On Mac OS/X in both Firefox and Chrome, the mouse cursor disappears when I type. Is there anyway in javascript to prevent this behavior or to force the cursor to become visible again?
I’m using jquery for the keyboard handling:
// keyboard handlers
$(document).keydown(this.keydown);
$(document).keyup(this.keyup);
…
keydown: function(evt) {
var app = PGE_LIB.game();
switch(evt.which) {
case 'G'.charCodeAt(0):
app.activateGrabTool();
break;
case 'S'.charCodeAt(0):
$('#toolbar img').removeClass('activeTool');
$('#scaleTool').addClass('activeTool');
break;
case app.ESC_KEY:
app.deactivateTool();
break;
case app.SHIFT_KEY:
app._shiftKeyDown = true; break;
default:
break;
}
},
If you’re using custom cursors, when your key event fires, you can detect the cursor position and display an image in its place until the next
mousemove. In this case, you should also hide the image for un-handled key events. And if you’re not using custom cursors, be aware that you will probably be presenting some users with a different version of the standard cursor than their OS or browser or user-installed cursor set displays.