Listbox vs. other control hotkeys
Listbox vs. other control hotkeys
I am trying to fix a bug in my Filters plugin: When I open the plugin's configuration, I cannot use default keyboard shortcuts on buttons (e.g. ALT+N or N for New Filter) as long as the listbox is focused. I can do it if I specifically capture the DN_CONTROLINPUT message, but that is only really feasible for custom shortcuts (e.g. INSERT for New Filter), not for the default ones - because the default ones can be user-controlled by modifying the language file (e.g. if I capture ALT+N and the user changes "&New" to "Ne&w", typically while translating the plugin). Can this behavior be somehow overcome, i.e. can I force Listbox to ignore keys other than the cursor movement and pass them on to the rest of the dialog? I would have thought that not using DIF_LISTNOAMPERSAND would solve the problem, but apparently that is not the case.
Listbox vs. other control hotkeys
pepak
@XeRoX wrote:Interesting. For sure you can invent some macros for that, catching input on listbox, analyzing is it any hotkey combination, and if it is, probably moving the focus out of ListBox, applying the key combination, then finally moving focus back to the List/Combo.
Or somehow directly set the dialog control value upon receiving in List/ComboBox hotkey combination for it
Last edited by citRiks on Mon 16 Mar, 2020 14:07, edited 2 times in total.
Listbox vs. other control hotkeys
I would also recommend translate your post in russian and post it in relevant russian forum,
there is much more active developers, than in entire other non-russian together, sad, bad true
there is much more active developers, than in entire other non-russian together, sad, bad true
-
- Posts: 6834
- Joined: Thu 23 Mar, 2006 21:36
- Location: Israel
- Has thanked: 41 times
- Been thanked: 530 times
Listbox vs. other control hotkeys
99% of active developers in Far Manager field know English so there's absolutely no problem with that.
Listbox vs. other control hotkeys
Shmuel, probably you right
can you say something about @XeRoX's suggestion?
PS
Is there probably something like dlg.GetHotKeys() fetching all the defined hotkeys dialog-wide?
can you say something about @XeRoX's suggestion?
PS
Is there probably something like dlg.GetHotKeys() fetching all the defined hotkeys dialog-wide?
-
- Posts: 6834
- Joined: Thu 23 Mar, 2006 21:36
- Location: Israel
- Has thanked: 41 times
- Been thanked: 530 times
Listbox vs. other control hotkeys
I think there is some deficiency in Far ListBox features that can be solved in Far itself.
Listbox vs. other control hotkeys
Shmuel,
do you think it makes sense to open feature request, and which?
the consideration to decide about and interesting to know as well,
is it easy for FAR group implement the missing parts?
and which missing parts exactly?
technically in Lua script, upon dialog initializing,
you may as well go thru all the dialog element,
find all "&" in it, and so you have all Alt+<*> hotkeys in "generic" way.
And further In the input(key( event catcher you may relate "Alt+<*>" to corresponding element
I personally think there is no hope somebody of FAR developers will do any steps to improve the API here,
so the only hope is as me or @XeRoX suggested, andto say honestly,
it does not seem to be very hard for experienced Lua FAR programmer as Pepak seems to be
do you think it makes sense to open feature request, and which?
the consideration to decide about and interesting to know as well,
is it easy for FAR group implement the missing parts?
and which missing parts exactly?
technically in Lua script, upon dialog initializing,
you may as well go thru all the dialog element,
find all "&" in it, and so you have all Alt+<*> hotkeys in "generic" way.
And further In the input(key( event catcher you may relate "Alt+<*>" to corresponding element
I personally think there is no hope somebody of FAR developers will do any steps to improve the API here,
so the only hope is as me or @XeRoX suggested, andto say honestly,
it does not seem to be very hard for experienced Lua FAR programmer as Pepak seems to be
Listbox vs. other control hotkeys
That is certainly a possibility which would resolve my immediate problem, but as far as I am concerned, it would be a very bad idea. This should be handled by Listbox, not some workarounds. I mean, if we are going this way, why not ignore FAR's Dialog API completely and draw by working directly with the console? After all, in DN_CONTROLINPUT there's no need for Listbox to handle anything else than the cursor movement, it can just as well leave any other keys to the default handling. Or, if there is a need, why not add a new flag which would reduce the keyboard processing to the bare minimum? In fact, it would be quite sufficient if I could send the message data from DN_CONTROLINPUT to the rest of the dialog...citRiks wrote: ↑Mon 16 Mar, 2020 14:05 pepak@XeRoX wrote:Interesting. For sure you can invent some macros for that, catching input on listbox, analyzing is it any hotkey combination, and if it is, probably moving the focus out of ListBox, applying the key combination, then finally moving focus back to the List/Combo.
Or somehow directly set the dialog control value upon receiving in List/ComboBox hotkey combination for it
Listbox vs. other control hotkeys
I am afraid my experience with opening requests does not fill me with optimism. These days, I generally modify my build of FAR and leave the changes private because it seems pointless to write requests, even requests asking for my code to be added to FAR's codebase :-(.
- HaRT
- Moderator
- Posts: 10858
- Joined: Tue 30 Aug, 2005 17:21
- Has thanked: 221 times
- Been thanked: 358 times
Listbox vs. other control hotkeys
Creating a Pull Request at GitHub is not complicated, but you'd better discuss the proposed changes with FAR maintainers here at the forum first and should be prepared for a thorough peer review of your code before the PR gets accepted.
Фар есть инструмент, а не нянька. © 2009 DrKnS
Listbox vs. other control hotkeys
I will need to do some testing, but it seems to me that extending the condition on line 2896 in dialog.cpp with something along the lines of "and no keyboard modifiers are pressed and DIF_LISTNOAMPERSAND is present" would do the trick.
Note to self: search for the second occurrence of:
and experiment with that.
Note to self: search for the second occurrence of:
Code: Select all
if (Items[m_FocusPos].Type == DI_LISTBOX)
Last edited by pepak on Mon 16 Mar, 2020 18:38, edited 1 time in total.
Listbox vs. other control hotkeys
Sorry, I have pretty much given up trying to contribute already. It seems impossible to get any kind of reaction to code proposals, even if it should be "we don't want it because you are too ugly". :-((
Listbox vs. other control hotkeys
@Pepak opened bug request, unportunately got zero response
"Listbox captures all keyboard events"
viewtopic.php?f=41&t=11099
https://bugs.farmanager.com/view.php?id=3586
Developers are too busy with other stuff, we know,
and naturally regular people like us are not willing make those developer's lives even worse
"Listbox captures all keyboard events"
viewtopic.php?f=41&t=11099
https://bugs.farmanager.com/view.php?id=3586
Developers are too busy with other stuff, we know,
and naturally regular people like us are not willing make those developer's lives even worse