How to show the mouse cursor in the browser while typing?

On Mac OS / X in Firefox and Chrome, the mouse cursor disappears as you type. Is there anyway in javascript to prevent this behavior or to make the cursor become visible again?

I use jquery to handle the keyboard:

// 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; } }, 
+4
source share
3 answers

If you use custom cursors when a key event fires, you can detect the cursor position and display the image in its place until the next mousemove . In this case, you should also hide the image for inactive key events. And if you are not using custom cursors, keep in mind that you are likely to represent some users with a different version of the standard cursor than their OS or browser or user-set cursor set settings.

+4
source

This is the expected behavior in these browsers. User behavior is awaiting. Fortunately, there is no way to disable this.

Personally, I find that many UI solutions for OS X are infuriating, but since this is standard behavior in OS X, changing this will certainly run counter to user expectations.

EDIT

I don’t have a Mac at the moment, so I can: t check this out, but see http://api.jquery.com/event.preventDefault/

you can use event.preventDefault() to change the behavior of some elements by default. This does not always work, and afaik the mouse cursor problem disappears - this is the behavior of the entire OS, and not specific to the browser.

+5
source

Sorry, but you cannot disable this feature of the embedded operating system through a browser.

screenshot

0
source

All Articles