Hi all,

This regards ctwm version 4.0.1, which I compiled myself using the make
command...

As I mentioned in an earlier post, I'm making a keyboard-friendly ctwm
setup. Once a menu is on the screen (I put it up via a hotkey invoking
f.menu "defops", where "defops" is the main menu), and my .ctwmrc has
AutoFocusToTransients), I can use the space bar to go down, backspace to
go up, and Esc to go up to the next higher menu level or exit the top
level menu.

However, there's still a problem with descending to a lower menu level.
Although the Enter key works beautifully on a leaf level item,
executing the associated command, on an item that calls a submenu the
Enter key acts like Escape: It exits the menu.

To me this is unexpected behavior. Most menus that use Enter to invoke
a choice invoke that choice whether it's a choice to run a command or a
choice to display a submenu. Either this is a bug in ctwm or there's a
logic I'm just not seeing.

So what I did was, using ctwm 4.0.1, I went into event_handlers.c,
where line 702 looks like the following:

        if(!strcmp(keynam, "Return")) {

This line of code prevents normal actions on a choice if the user had
pressed Enter. So I changed "Return" to "Returnz", which makes the line
always true because there's no key called "Returnz". After making this
change, ctwm menus act as expected: Enter executes a command on command
type choices, and displays a submenu on submenu type choices. To
repeat, after I made my change, line 702 looked like the following:

        if(!strcmp(keynam, "Returnz")) {

At this point I can't call my workaround a solution, because I don't
know the original intent of testing for "Return" at that point, so my
workaround might have unintended side effects. I'm not sure what side
effect that would be, because none of this code is executed unless the
item->func is F_MENU, which I assume means "we're in a menu."

Could somebody please look at this code and deduce the purpose of the
comparison of keynam to "Return", so that a real solution can be found
instead of my workaround?

Thanks,

SteveT

Steve Litt
September 2017 featured book: Manager's Guide to Technical
Troubleshooting Brand new, second edition
http://www.troubleshooters.com/mgr

Reply via email to