No KeyDown event for Command + Ctrl + Enter on macOS

"[email protected]" <[email protected]> Mon, 18 Apr 2022 17:22:52 -0700 (PDT)
Newsgroups gmane.comp.python.wxpython
Message-ID <[email protected]>
------=_Part_5064_317602639.1650327772791
Content-Type: multipart/alternative; 
	boundary="----=_Part_5065_198880565.1650327772791"

------=_Part_5065_198880565.1650327772791
Content-Type: text/plain; charset="UTF-8"

wxPython 4.1.1

Run wxdemo on Windows 7 or 10, pull up the KeyEvent demo.
Press Ctrl-Alt-Enter on your PC keyboard, and you'll see this:


*Event Type      Key Name        Key Code        Modifiers*KeyDown         
WXK_ALT         307             -A---
KeyDown         WXK_CONTROL     308             CA--R
*KeyDown         WXK_RETURN      13              CA--R*
KeyUp           WXK_RETURN      13              CA--R
KeyUp           WXK_CONTROL     308             -A---
KeyUp           WXK_ALT         307             -----

Noticed highlighted KeyDown event for Enter with Ctrl + Alt pressed, which 
is what I'd expect.

Run the same demo on macOS 10.15 or 11, this time pressing 
Command+Ctrl+Enter:

*Event Type      Key Name        Key Code        Modifiers*
KeyDown         WXK_COMMAND     308             C----
KeyDown         WXK_RAW_CONTROL 396             C---R
       *<--- no KeyDown for 13 with C---R? --> *
KeyUp           WXK_RETURN      13              C---R
KeyUp           WXK_COMMAND     308             ----R
KeyUp           WXK_RAW_CONTROL 396             -----

... there's no KeyDown for the return key with CR modifiers. Why not? Is 
that a bug?

I thought this might be something about macOS -- but here's a simple web 
page that grabs key events in 
Javascript: https://unixpapa.com/js/testkey.html

For Windows it shows what we'd expect: keydown 13, ctrl/alt true.

keydown  keyCode=13        which=13        charCode=0        
         shiftKey=false ctrlKey=true  altKey=true  metaKey=false

For mac - also exactly what I'd expect: keydown for 13, ctrl/meta true.

keydown  keyCode=13        which=13        charCode=0        
         shiftKey=false ctrlKey=true  altKey=false metaKey=true 

So it would appears other applications (at least, browser) can see that 
event just fine.

Why can't wxPython see a KeyDown for Enter with Command and Control both 
pressed on macos?

Thanks for any pointers or workarounds:
-ck


-- 
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/34b20ba1-1fba-4f82-b2f0-78f4d36f7fd9n%40googlegroups.com.

------=_Part_5065_198880565.1650327772791
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

wxPython 4.1.1<div><br><div>Run wxdemo on Windows 7 or 10, pull up the KeyE=
vent demo.</div><div>Press Ctrl-Alt-Enter on your PC keyboard, and you'll s=
ee this:</div><div><br></div><font face=3D"Courier New"><u>Event Type &nbsp=
; &nbsp; &nbsp;Key Name &nbsp; &nbsp; &nbsp; &nbsp;Key Code &nbsp; &nbsp; &=
nbsp; &nbsp;Modifiers<br></u>KeyDown &nbsp; &nbsp; &nbsp; &nbsp; WXK_ALT &n=
bsp; &nbsp; &nbsp; &nbsp; 307 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -A-=
--<br>KeyDown &nbsp; &nbsp; &nbsp; &nbsp; WXK_CONTROL &nbsp; &nbsp; 308 &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CA--R<br><b><font style=3D"backgroun=
d-color: yellow;" color=3D"#000000">KeyDown &nbsp; &nbsp; &nbsp; &nbsp; WXK=
_RETURN &nbsp; &nbsp; &nbsp;13 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp;CA--R</font></b><br>KeyUp &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WXK_RETURN=
 &nbsp; &nbsp; &nbsp;13 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CA-=
-R<br>KeyUp &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WXK_CONTROL &nbsp; &nbsp; 30=
8 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -A---<br>KeyUp &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; WXK_ALT &nbsp; &nbsp; &nbsp; &nbsp; 307 &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; -----<br></font><div><br></div><div>Noticed highl=
ighted KeyDown event for Enter with Ctrl + Alt pressed, which is what I'd e=
xpect.</div><div><br></div><div>Run the same demo on macOS 10.15 or 11, thi=
s time pressing Command+Ctrl+Enter:</div><div><br></div><div><font face=3D"=
Courier New"><u>Event Type &nbsp; &nbsp; &nbsp;Key Name &nbsp; &nbsp; &nbsp=
; &nbsp;Key Code &nbsp; &nbsp; &nbsp; &nbsp;Modifiers</u><br>KeyDown &nbsp;=
 &nbsp; &nbsp; &nbsp; WXK_COMMAND &nbsp; &nbsp; 308 &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; C----<br>KeyDown &nbsp; &nbsp; &nbsp; &nbsp; WXK_RAW_CON=
TROL 396 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; C---R</font></div><div><=
font face=3D"Courier New"><span style=3D"background-color: yellow;">&nbsp; =
&nbsp; &nbsp; &nbsp;<b>&lt;--- no KeyDown for 13 with C---R? --&gt;&nbsp;</=
b></span><br>KeyUp &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WXK_RETURN &nbsp; &nb=
sp; &nbsp;13 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;C---R<br>KeyUp=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WXK_COMMAND &nbsp; &nbsp; 308 &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; ----R<br>KeyUp &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; WXK_RAW_CONTROL 396 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -----=
<br></font></div><div><font face=3D"Courier New"><br></font></div><div>... =
there's no KeyDown for the return key with CR modifiers. Why not? Is that a=
 bug?</div><div><br></div><div>I thought this might be something about macO=
S -- but here's a simple web page that grabs key events in Javascript:&nbsp=
;https://unixpapa.com/js/testkey.html</div><div><br></div><div>For Windows =
it shows what we'd expect: keydown 13, ctrl/alt true.</div><div><br></div><=
div><font face=3D"Courier New">keydown &nbsp;keyCode=3D13 &nbsp; &nbsp; &nb=
sp; &nbsp;which=3D13 &nbsp; &nbsp; &nbsp; &nbsp;charCode=3D0 &nbsp; &nbsp; =
&nbsp; &nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;shiftKey=3Dfalse ctrlKey=
=3Dtrue &nbsp;altKey=3Dtrue &nbsp;metaKey=3Dfalse<br></font></div><div><br>=
</div><div>For mac - also exactly what I'd expect: keydown for 13, ctrl/met=
a true.</div><div><br></div><div><font face=3D"Courier New">keydown &nbsp;k=
eyCode=3D13 &nbsp; &nbsp; &nbsp; &nbsp;which=3D13 &nbsp; &nbsp; &nbsp; &nbs=
p;charCode=3D0 &nbsp; &nbsp; &nbsp; &nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp;shiftKey=3Dfalse ctrlKey=3Dtrue &nbsp;altKey=3Dfalse metaKey=3Dtrue&nb=
sp;</font><br></div><div><br></div><div>So it would appears other applicati=
ons (at least, browser) can see that event just fine.</div><div><br></div><=
div>Why can't wxPython see a KeyDown for Enter with Command and Control bot=
h pressed on macos?</div><div><br></div><div>Thanks for any pointers or wor=
karounds:</div><div>-ck</div><div><br></div><div><br></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;wxPython-users&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">wxpy=
[email protected]</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/d/msgid/wxpython-users/34b20ba1-1fba-4f82-b2f0-78f4d36f7fd9n%40googlegro=
ups.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com/d=
/msgid/wxpython-users/34b20ba1-1fba-4f82-b2f0-78f4d36f7fd9n%40googlegroups.=
com</a>.<br />

------=_Part_5065_198880565.1650327772791--

------=_Part_5064_317602639.1650327772791--