ux
play

UX Manuel Matuzovi @mmatuzo pitercss 06/2017 Manuel Matuzovic - PowerPoint PPT Presentation

ACCESSIBLE UX Manuel Matuzovi @mmatuzo pitercss 06/2017 Manuel Matuzovic Manuel Matuzovi , , , d , , , nj, lj q, w, x Keyboard layouts A keyboard layout is any specific mechanical, visual, or functional arrangement


  1. ACCESSIBLE UX Manuel Matuzovi ć @mmatuzo pitercss 06/2017

  2. Manuel Matuzovic

  3. Manuel Matuzovi ć

  4. č , ć , đ , d ž , š , ž , nj, lj q, w, x

  5. Keyboard layouts “A keyboard layout is any specific mechanical, visual, or functional arrangement of the keys, legends, or key-meaning associations (respectively) of a computer, typewriter, or other typographic keyboard.” Wikipedia

  6. QWERTY

  7. QWERTZ

  8. AZERTY

  9. JCUKEN

  10. Soooo?

  11. event.keyCode window.addEventListener('keydown', navigate); function navigate(e) { ... if (e.keyCode === 68) { moveLeftAndRight(1); } if (e.keyCode === 90) { shootMissile(); } }

  12. Issues • Di ff erent meaning of properties when handling a key event (keydown or keyup) versus a character event (keypress). • The values of keys in keypress events are di ff erent between browsers. • Inconsistent values for keys and events cross-browser • keyCode on key events tries to be international-friendly , but isn’t

  13. w forward s back W Z a le fu A S D d right z shoot

  14. QWERTZ QWERTY

  15. QWERTY

  16. Remember AZERTY?

  17. UI Events: API • Two new properties: key and code • event.key - printable character or a descriptive string, e.g. z • event.code - physical key, e.g. KeyY • Reference keyboard in the specification

  18. Reference keyboard

  19. event.keyCode window.addEventListener('keydown', navigate); function navigate(e) { ... if (e.code === 'KeyD') { moveLeftAndRight(1); } if (e.code === 'KeyY') { shootMissile(); } }

  20. Browsersupport

  21. Browsersupport

  22. Fallback switch(e.code || e.keyCode ) { ... case 'KeyD': case 'ArrowRight': case 39: moveLeftAndRight(1); 
 ... }

  23. Notes • There is no way of checking for the current keyboard layout. • Use the repeat property to check if the user keeps pressing a key and the event is sent repeatedly • Boolean properties for modifier keys ( altKey, ctrlKey, metaKey, shiftKey ). • Still a Working Dra fu : There are some inconsistencies between browsers.

  24. https://codepen.io/matuzo/pen/PmgWRm?editors=0010

  25. TWEETABLE TAKE-AWAY The web is international and so are your users. Don’t assume that all users use the same input devices.

  26. lang a tu ribute

  27. lang a tu ribute <!DOCTYPE html > <html lang ="en" > <head> <title> Document </title> </head> <body> </body> </html>

  28. lang a tu ribute: impacts • Assistive Technology • Translation tools and browsers • Quote characters • Date and Number inputs • Search engines • Hyphenation

  29. TWEETABLE TAKE-AWAY Make sure to tell the browser the correct language in use. Everyone benefits from it.

  30. keyboard usage

  31. Surfing the web without a mouse sucks…

  32. …and it’s our fault!

  33. BUT!

  34. We can fix it!

  35. Missing or insu ffi cient focus styles

  36. :focus styling * { outline : none; }

  37. :focus styling a :focus { color : #FF00FF; }

  38. :focus-ring a :focus-ring { outline : 1px solid #FF00FF; } Polyfill: https://github.com/WICG/focus-ring

  39. :focus-within form :focus-within { background :#FF00FF; }

  40. Browsersupport

  41. Tabbable/focusable elements • Input elements, selects, textareas • Links • Contenteditable elements • audio, video with controls • …

  42. tabindex (focusable and tabbable) <h2 tabindex ="0" > A focusable heading </h2>

  43. tabindex (just focusable) <h2 tabindex ="-1" > A focusable heading </h2>

  44. Bad Semantics

Recommend


More recommend