Re: xkbcommon: Converting keysym to keycode

2022-08-06 Thread adlo
afaict there’s a for loop that iterates over all the layouts, and within that it iterates over all the shift levels, and within that it iterates over all the modifier masks? Is that what’s going on? So basically it’s iterating over them until it finds a match? In that printf on line 220, would

Re: xkbcommon: Converting keysym to keycode

2021-12-06 Thread adlo
> On 5 Dec 2021, at 05:15, Peter Hutterer wrote: > > please look at the source, it's not a huge program. I have looked at the source, it’s just that I can’t see anything that’s directly related to what I’m trying to do. It calls xkb_keymap_key_get_mods_for_level(), which seems to be related to

Re: xkbcommon: Converting keysym to keycode

2021-12-06 Thread Peter Hutterer
On Sat, Dec 04, 2021 at 08:34:49AM +, adlo wrote: > Basically the program I’m working on was originally designed for X11, and I’m > trying to adapt it to Wayland. I’m trying to find an equivalent to > XKeysymToKeycode(). > > > it doesn't, but if you look at xkbcli how-to-type and it's source

Re: xkbcommon: Converting keysym to keycode

2021-12-06 Thread adlo
Does xkbcommon have modifier masks, like that used in the “state” field of XKeyEvent? > On 4 Dec 2021, at 08:34, adlo wrote: > > Basically the program I’m working on was originally designed for X11, and > I’m trying to adapt it to Wayland. I’m trying to find an equivalent to > XKeysymToKeyco

Re: xkbcommon: Converting keysym to keycode

2021-12-06 Thread adlo
Basically the program I’m working on was originally designed for X11, and I’m trying to adapt it to Wayland. I’m trying to find an equivalent to XKeysymToKeycode(). > it doesn't, but if you look at xkbcli how-to-type and it's source > (tools/how-to-type.c) that's the closest approximation. What

Re: xkbcommon: Converting keysym to keycode

2021-12-01 Thread Peter Hutterer
On Wed, Dec 01, 2021 at 02:31:38PM +, adlo wrote: > Does xkbcommon have a function to convert a keysym to a keycode? it doesn't, but if you look at xkbcli how-to-type and it's source (tools/how-to-type.c) that's the closest approximation. Main reason is that the keycode->keysym conversion is

Re: xkbcommon: Converting keysym to keycode

2021-12-01 Thread Andri Yngvason
Hi adlo mið., 1. des. 2021 kl. 14:31 skrifaði adlo : > > Hi > > Does xkbcommon have a function to convert a keysym to a keycode? It does not, last time I checked, but "xkb_keymap_key_get_mods_for_level" does help a lot. Wayvnc does this sort of reverse key mapping. Maybe this helps? See: https:/