Image resize script using PTM ratio and level building

General discussion about the R.U.B.E editor
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: Image resize script using PTM ratio and level building

Post by iforce2d »

I seem to recall there was some problem with using Shift for this, otherwise I would have used it as well. I don't have the details in front of me right now but I think the status of the Shift key is simply not provided by the Qt API at all, because unlike Ctrl and Alt, the Shift key actually results in a completely different character. For example Ctrl+a still gives you 'a', but Shift+a gives you 'A'. For number keys this means you have no way to know which original number was pressed, without knowing the keyboard layout.

Assuming my memory of that is correct, the only way it could work is to add a dialog for the user to set up a custom mapping where you would specify what character the Shift modifier will result in for each number key. So for example, when the character is ' (single quote) the program would know you actually pressed Shift+7, and a " (double quote) meant that you actually pressed Shift+2. At least that would be the case for my keyboard. I think I decided that already having 40 possibilities per number key, and therefore 400 possibilities total, was probably enough.
Post Reply