accessibility - Javascript keyevent and JAWS screen reader -


i have application (eg alert) each time spacebar pressed. works fine if not using jaws screen reader. however, once load jaws screen reader, not execute alert when press spacebar. need use jaws need work. here code snippet.

$(document).keypress(function(event) {     var chcode = ('charcode' in event) ? event.charcode : event.keycode;     if (chcode == 32){ //32 keycode spacebar       alert("spacebars!!!");     } }); 

from observation, seems jaws grabs keyboard focus , wouldn't allow spacebar event fire. jaws reads "space" when press spacebar alert event not fire. how can still alert or dosomething() fire when spacebar pressed? how can take control jaws or maybe share keyboard control jaws such though jaws reads out character pressed (in case spacebar), allow event (alert) fire. thanks.

more code:

$(document).keypress(function(event) {   var cc= ('charcode' in event) ? event.charcode : event.keycode;               if (cc == 32)     {       sparray.push(number(new date()));     } }); 

in general not advisable over-ride screen readers, if let you. there quite few jaws keyboard commands (in conjunction ins) use spacebar, , you'd lock commands out.

if area form controls or interactive widgets wrap in element role="application". puts (windows) screen reader 'forms' mode, keys passed through web-page.

do not wrap in role="application", interactive area.

update: more information, audio-based capture user triggers audio file, triggers again set time , pass capture.

using native button, jaws pass through use of enter (not sure space, isn't usual 'activate' key). i'd suggest either checking enter key (charcode 13 think), or onclick should work. on native button/link works across screen readers.

$(document).click(function() {    sparray.push(number(new date())); }); 

assuming that's in right location doesn't become active until needed. (js isn't strong point, go enter key or onclick.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -