Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 17466c1

Browse files
committed
Fix "return"->"enter" mapping in key names.
All backends previously normalized both the return key and the (numpad) enter to "enter" (see e.g. the presence of two "enter" entries in the old FigureCanvas{GTK3,Tk}.keyvald . When revamping the gtk and tk key names lookup I accidentally normalized both to "return" instead, so fix that. Test with ``` gcf().canvas.mpl_connect("key_press_event", lambda e: print(e.key)) ```
1 parent a510e32 commit 17466c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/cbook/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2308,7 +2308,7 @@ def _unikey_or_keysym_to_mplkey(unikey, keysym):
23082308
if key.endswith(("_l", "_r")): # alt_l, ctrl_l, shift_l.
23092309
key = key[:-2]
23102310
key = {
2311-
"enter": "return",
2311+
"return": "enter",
23122312
"prior": "pageup", # Used by tk.
23132313
"next": "pagedown", # Used by tk.
23142314
}.get(key, key)

0 commit comments

Comments
 (0)