This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author spacether
Recipients spacether
Date 2020-12-20.21:22:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1608499373.07.0.718041853104.issue42695@roundup.psfhosted.org>
In-reply-to
Content
Hi there.
On my MacOS 10.14.16 laptop with a qwerty keyboard I was testing tkinter keyboard listening for an azerty keyboard layout by switching the layout to `French - PC`
When I press qwerty keys Shift + \ I expect to see 'μ' printed.
When looking at the tkinter events for that key press we see:
```
down {'keysym': 'Shift_L', 'keysym_num': 65505, 'keycode': 131072, 'char': ''}
down {'keysym': 'tslash', 'keysym_num': 956, 'keycode': 956, 'char': 'μ'}
up {'keysym': 'asterisk', 'keysym_num': 42, 'keycode': 2753468, 'char': 'μ'}
up {'keysym': 'Shift_L', 'keysym_num': 65505, 'keycode': 131072, 'char': ''}
```
So the char value is correct but the keysym_num is not the expected 181 for mu.
Comparing this to pressing Shift + / to generate the section symbol (§) we see:
```
down {'keysym': 'Shift_L', 'keysym_num': 65505, 'keycode': 131072, 'char': ''}
down {'keysym': 'section', 'keysym_num': 167, 'keycode': 167, 'char': '§'}
up {'keysym': 'section', 'keysym_num': 167, 'keycode': 2883751, 'char': '§'}
up {'keysym': 'Shift_L', 'keysym_num': 65505, 'keycode': 131072, 'char': ''}
```
Which produces the expected keysym_num of 167.

TLDR: the kysym_num value when writing the mu character is incorrect. It should be 181 and logging shows values of 956 and 42. Can this be fixed?

Here is the keyboard listener program which can be used for verification:
```
from tkinter import *

params = ['keysym', 'keysym_num', 'keycode', 'char']

def keyup(e):
    d = {p: getattr(e, p) for p in params}
    print('up', d)
    # print('up', e.__dict__)
def keydown(e):
    d = {p: getattr(e, p) for p in params}
    print('down', d)
    # print('down', e.__dict__)
    pass

root = Tk()
frame = Frame(root, width=100, height=100)
frame.bind("<KeyPress>", keydown)
frame.bind("<KeyRelease>", keyup)
frame.pack()
frame.focus_set()
root.mainloop()
```
Note: my python version was installed from python.org and is:
```
Python 3.9.1 (v3.9.1:1e5d33e9b9, Dec  7 2020, 12:44:01) 
[Clang 12.0.0 (clang-1200.0.32.27)] on darwin
```
History
Date User Action Args
2020-12-20 21:22:53spacethersetrecipients: + spacether
2020-12-20 21:22:53spacethersetmessageid: <1608499373.07.0.718041853104.issue42695@roundup.psfhosted.org>
2020-12-20 21:22:53spacetherlinkissue42695 messages
2020-12-20 21:22:52spacethercreate