Re: [whatwg/fullscreen] Keyboard lock (Issue #231)

@martinthomson , @marcoscaceres 

I have evaluated the current keyboard lock interface and found that it should be working with the preventDefault call.
As following test codes. 

Do both of you think it's ok to madate  adding the steps of calling "preventDefault()" in case of the keys which need to be locked by the application? Which was not required by the <https://wicg.github.io/keyboard-lock/> spec.

`document.addEventListener("keydown", (e) => {
  if (
    lock &&
    (e.code === "Escape" ||
      ((e.code === "KeyN" || e.code === "KeyT" || e.code == "KeyP"
              || e.code == "KeyW" || e.code == "KeyQ" ) &&
        (event.ctrlKey || event.metaKey)))
  ) {
    // handling events.
    
    e.preventDefault();
  }
});`

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fullscreen/issues/231#issuecomment-1863247730
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fullscreen/issues/231/1863247730@github.com>

Received on Tuesday, 19 December 2023 18:03:10 UTC