giuspen / cherrytree

cherrytree
https://www.giuspen.net/cherrytree/
Other
3.3k stars 458 forks source link

Not possible to enter { }and [] in normal nodes #2423

Closed Hoffenbar closed 5 months ago

Hoffenbar commented 6 months ago

Version, Operative system 1.0.4 on Windows10

Describe the bug It is not possible, in rtf-nodes and text-nodes and code-boxes (possibly everywhere outside tables?) to enter the characters "[]{}" via keyboard:

Screenshots

image

giuspen commented 5 months ago

What key combination do you need to press on your keyboard to get "[]{}"? Have you tried to reset all the keyboard shortcuts to the default in the preferences dialog? I'm surprised because the issues were coming from the default shortcuts Ctrl+Alt (triggered by AltGr on windows) but now they are all gone in 1.0.4

Groberen commented 5 months ago

I have same problem (probably) and same OS and CT version. Norwegian keyboard layout.

Assume original keymap without any custom changes in CT settings: Pressing AltGr+8 (to produce left square bracket) or AltGr+9 gives an error message about a table (didn't wrote down the exact error message, but it obvious expect the cursor to be located in a table).

Solution is to disable the shortcuts for "increase/decrease height of codebox". However, looking at this keyboard shortcut doesn't suggest this conflict should be able to exist.

That is - there shouldn't be a conflict/confusion between program shortcut Alt+] and actual user input AltGr+9. The shortcut Alt+] is not possible to press using a Scandinavian keyboard layout (possible true for other European languages like German as well) because the character ] can only be inserted by pressing AltGr+9.

giuspen commented 5 months ago

Thanks @Groberen I will investigate. Would be useful if you can confirm the exact warning messages that you get, it's surprising that are related to the table but it's disabling the codebox shortcut that fixes it

Groberen commented 5 months ago

Ok I've tested. First I renamed the config.cfg so to reset all settings. Then created a new instance (not save) and a new node. Then placed the cursor within the terminal/text.

AltGr+8 (is expected to insert «[» character)

But it gives this error message: _

Error No Table is Selected [OK]

_

Likewise AltGr+9 (is expected to insert «]» character), but also gives the excact same error message.

Also, the following key combinations give the same error message AltGr+0 (is expected to insert «}» character) AltGr+7 (is expected to insert «{» character)

Hope this helps

giuspen commented 5 months ago

@Groberen your test is very useful and would be very useful if you will accept to give a try to a development build I will prepare after a proposal fix.

Groberen commented 5 months ago

Yes - but I'll be pretty busy the next days, but after that (i.e. late in next week) I may be able to find time to test the Windows.

giuspen commented 5 months ago

Apparently the offending keyboard shortcuts are Ctrl+[, Ctrl+], Ctrl+{, Ctrl+} Theoretically AltGr should be detected as Ctrl+Alt on windows but for some reason it is still triggering those. I will see if I can reproduce myself adding the Norwegian and German keyboards.

giuspen commented 5 months ago

I managed to add keyboard layouts to my Win11 and reproduce the issue. I'm confident with the fix (6 default keyboard shortcuts changed) but if anybody is interested in having a pre release build just write here and I'll build it

vitusb commented 2 months ago

Hello ...

The ALT-GR+"backslash" issue on a german keyboard is still not "masked to another mapping", so ALT-GR+"\" is not usable in order to enter a "\" on german keyboards.

For Details, see: https://github.com/giuspen/cherrytree/commit/bdd8737b7625711be0e35c290a0ee083bb104ff7#commitcomment-140949469