Alexey-T / CudaText

Cross-platform text editor, written in Free Pascal
Mozilla Public License 2.0
2.54k stars 174 forks source link

Find dialog hotkeys should have priority over menubar Alt + letter #4925

Closed pintassilgo closed 1 year ago

pintassilgo commented 1 year ago

For instance, Alt + O is the default hotkey to count all when find dialog is active. But Alt is also the universal modifier to activate menubar. I use CudaText in English, so Alt + O activates Options menu in menubar, making the default hotkey for count all unworkable.

When find dialog is active, find-specific hotkeys such as "count all" should have preference over other global hotkeys like the Alt + letter for navigating menubar.

Alexey-T commented 1 year ago

I am afraid, it cannot be fixed, LCL first passes hotkey to MainMenu. workaround: make custom menu with ConfigMenu plugin.

pintassilgo commented 1 year ago

I expected this answer. In this case, my suggestion is to change default find dialog hotkeys away from Alt + letter combinations, as they simply don't work when the letter is already assigned as accesskey for a menu, something is hard to predict because user language varies.

Or use find_separate_form = true by default. I didn't test, but I guess having Find in separated window would prevent conflicts with main window menu accesskeys.

The way the current defaults are presented, it's a bug, some hotkeys don't work and requires the user to change them to fix (without actually notifying the user about the issue). There shouldn't be a hotkey conflict with default options.

Alexey-T commented 1 year ago

All find-hotkeys can be changed to

    HotkeyReplaceAndFindNext:= 'Ctrl+Alt+Z';
    HotkeyReplaceNoFindNext:= 'Ctrl+Shift+Z';
    HotkeyReplaceAll:= 'Ctrl+Alt+A';
    HotkeyReplaceGlobal:= '';
    HotkeyCountAll:= 'Ctrl+Alt+O';
    HotkeyExtractAll:= 'Ctrl+Alt+Q';
    HotkeySelectAll:= 'Ctrl+Alt+E';
    HotkeyMarkAll:= 'Ctrl+Alt+K';
    HotkeyToggleRegex:= 'Ctrl+Alt+R';
    HotkeyToggleCaseSens:= 'Ctrl+Alt+C';
    HotkeyToggleWords:= 'Ctrl+Alt+W';
    HotkeyToggleWrapped:= 'Ctrl+Alt+N';
    HotkeyToggleInSelect:= 'Ctrl+Alt+X';
    HotkeyToggleMultiline:= 'Ctrl+Alt+M';
    HotkeyToggleConfirmRep:= 'Ctrl+Alt+Y';
    HotkeyToggleTokens:= '';
    HotkeyToggleHiAll:= '';
    HotkeyTogglePresCase:= '';

is it OK? @veksha @miroslavMatas @pintassilgo

pintassilgo commented 1 year ago

OK. For me any default hotkey is fine, supposing it doesn't conflict with the existing ones.

ildarkhasanshin commented 1 year ago

All find-hotkeys can be changed to

image image

если в user.json добавить "find_hotkey_replace_all": "Alt+A" то уже норм image

Alexey-T commented 1 year ago

@ildarkhasanshin не понял твое сообщение.

ildarkhasanshin commented 1 year ago

@ildarkhasanshin не понял твое сообщение.

хоткеи из options editor lite не соответствовали действительности в частности, для replace all выводилось alt+z, хотя на деле были ctrl+alt+z

после того, как в options editor lite переопределил хоткей для replace all т.е. добавилась строка find_hotkey_replace_all в user.json хоткей для данной команды стал одинаковый в options editor lite и попап-меню поиска/замены

Alexey-T commented 1 year ago

может ты использовал новый бинарник в котором дефолты не такие как в старом файле default.json?

Alexey-T commented 1 year ago

ой, я забыл обновить default.json. поправлю.

MiroslavMatas commented 1 year ago

ой, я забыл обновить default.json. поправлю.

plus - maybe update Wiki - https://wiki.freepascal.org/CudaText#Dialog_Find.2FReplace

Alexey-T commented 1 year ago

Of course, wiki updated now

MiroslavMatas commented 1 year ago

All find-hotkeys can be changed to

    HotkeyReplaceAndFindNext:= 'Ctrl+Alt+Z';
    HotkeyReplaceNoFindNext:= 'Ctrl+Shift+Z';
    HotkeyReplaceAll:= 'Ctrl+Alt+A';
    HotkeyReplaceGlobal:= '';
    HotkeyCountAll:= 'Ctrl+Alt+O';
    HotkeyExtractAll:= 'Ctrl+Alt+Q';
    HotkeySelectAll:= 'Ctrl+Alt+E';
    HotkeyMarkAll:= 'Ctrl+Alt+K';
    HotkeyToggleRegex:= 'Ctrl+Alt+R';
    HotkeyToggleCaseSens:= 'Ctrl+Alt+C';
    HotkeyToggleWords:= 'Ctrl+Alt+W';
    HotkeyToggleWrapped:= 'Ctrl+Alt+N';
    HotkeyToggleInSelect:= 'Ctrl+Alt+X';
    HotkeyToggleMultiline:= 'Ctrl+Alt+M';
    HotkeyToggleConfirmRep:= 'Ctrl+Alt+Y';
    HotkeyToggleTokens:= '';
    HotkeyToggleHiAll:= '';
    HotkeyTogglePresCase:= '';

is it OK? @veksha @MiroslavMatas @pintassilgo

PMFJI - if menu is disabled, as on my case /via ui_menu_show/… than I can stay with Alt+Letter… am I right? /I want be sure before reverting back those shortcuts…/

Alexey-T commented 1 year ago

than I can stay with Alt+Letter… am I right?

Right, you can change hotkeys back to Alt+x.