techee left a comment (geany/geany-plugins#1093)

@b4n You are right, `keymap_translate_keyboard_state()` wouldn't work here - I 
assumed that the `consumed` argument would contain the really consumed 
modifiers for the key press but after testing it, it contains only "potentially 
consumed" modifiers so it's useless here.

However, the trick I used is that in addition to `iShiftNumbers` I also 
precompute `iNoShiftNumbers` (that is the "bottom row" of the key with a 
number) and based on into which of these two groups the pressed key falls, 
determine whether Shift was pressed or not.

The result works for me both with the Czech keyboard (numbers in the top row 
after pressing Shift) and the US keyboard (numbers in the bottom row without 
Shift). In addition, these `iShift` values aren't computed once inside 
`plugin_init()` but after every Ctrl+key keystroke so one can change keyboard 
layout while using Geany and it still works.

See https://github.com/geany/geany-plugins/pull/1458.

> Word some amount happened here. So, am I folding in the state changes, or 
> should I just wait for this to get folded into the other change techee is 
> looking at?

@Davidy22 What I propose in https://github.com/geany/geany-plugins/pull/1458 is 
something completely different than this PR. The trouble of this PR is that 
it's not universal enough for all keyboard layouts.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/pull/1093#issuecomment-3014225799
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany-plugins/pull/1093/[email protected]>

Reply via email to