can3p → Dev Notes

Tue, 29 Nov 2022 15:02

Cmd-Enter doesn't work on Mac OS X because I use keyup event and apparentely this specific event is not fired when the meta/cmd key is pressed on mac os x

Example issue elsewhere: https://github.com/electron/electron/issues/5188

Suggested fix was to start listening to keydown instead

on keydown[(ctrlKey or metaKey) and key == 'Enter']
   call my checkValidity()
   if the result is true
     submit() me
   otherwise
     call my reportValidity()

Dabdab.org (c) 2022 — 2023, hi@dabdab.org / Contact us / Twitter