Open Thunar and navigate through various folders, e.g. /home > /home/mint/ > /home/mint/downloads/`
Press the back button on the keyboard
Observe how nothing happens
Press the back button in Thunar itself at least once
Press the forward button on the keyboard
Observe how nothing happens
Current behavior
Back and forward buttons on a keyboard do nothing
Expected outcome
Back and forward buttons on a keyboard should behave exactly like back and forward buttons on a mouse.
Additional information
It behaves correctly in Nemo since at least version 5.2.4 in the very same Mint Xfce 20.3, let alone the newest Nemo version of 6.2.1 in Mint Cinnamon 22(.0) beta.
That did indeed work, and the key names turn out to be the most anti-climatic things ever:
Back
Forward
I kid you not. I mean, I guess I shouldn't be surprised considering this is a standardized thing seeing as this is even a PS/2 keyboard from like 2000 or 2001 or so (though the behavior makes no difference even when connected via a USB adapter), and I know the old Windows XP-era "KeyTweak" program for remapping keyboard keys includes the aforementioned "back" and "forward" buttons among others:
EDIT: This might be outside of the scope of this issue but, it turns out that only Mail and HomePage are mapped by default with regards to the extra buttons. The rest have similarly anti-climatic key names:
Cancel (labeled "Stop" on my keyboard, i.e. what would be used in a web browser, but doesn't seem to work in Firefox)
Search
Favorites (works in Firefox; does nothing in Thunar despite working in Nemo)
Explorer (labeled "My Computer" on my keyboard; launches the default file manager on Mint Cinnamon)
I guess adding support for Search and Favorites in thunar should be simple. For the others, I suppose there is no reasonable thing to do in thunar / they rather belong to the system (Possibly xfce4-session?)
Just found out they can be emulated via xdotool. E.g. sleep 2;xdotool key 0x1008ff26 emulates Back (hex code of GDK_KEY_Back from the gtk-key-table)
While I'm at !485 (merged) I can add those as well. "Search" is fine, as is "Reload", however "Favorites" I presume should just popup the bookmarks menu...?
If so, how!? Unless I'm blind, there's no thunar_window_action_open_bookmarks_menu?
Just found out they can be emulated via xdotool. E.g. sleep 2;xdotool key 0x1008ff26 emulates Back
Names work too, eg sleep 2;xdotool key Escape, though only in XF86 notation (eg. xdotool key XF86Forward)
While I'm at !485 (merged) I can add those as well. "Search" is fine, as is "Reload"
, thanks!
however "Favorites" I presume should just popup the bookmarks menu...?
If so, how!? Unless I'm blind, there's no thunar_window_action_open_bookmarks_menu?
True, it's a bit more complex. If you want to go for it, take a look a thunar_window_action_open_file_menu which is currently executed on F10. I suppose it would be required to use gtk_container_get_children on the menu-shell and iterate on the result to get the correct child and use gtk_menu_shell_select_item on it.
Names work too, eg sleep 2;xdotool key Escape, though only in XF86 notation (eg. xdotool key XF86Forward)
If you want to go for it, take a look a thunar_window_action_open_file_menu which is currently executed on F10. I suppose it would be required to use gtk_container_get_children
Tried already exactly there, however got stuck on iterating the GList to find the Bookmarks menu widget to pass to gtk_menu_shell_select_item, gave up and went to bed.
Also, figured it'd be good to refactor/generalize the thunar_window_action_open_file_menu to thunar_window_action_open_menu so it can be reused for popping up any menu, though that looks like it's going to get complicated and potentially become a big change fast, so it's probably better to just add a new/separate function/callback for bmarks menu...
Anyhow, will be back to it in the following days...
Meanwhile, I pushed to rest and removed the Draft status, so go ahead and merge the !485 (merged) if you don't wanna wait or if you think it's better to send a separate MR for the bmarks, which would probably be better, esp. if I manage to whip the generalized thunar_window_action_open_menu into existance (G_UNLIKELY )
Thanks for the hint!
There's also ydotool, an xdotool replacement targeting Wayland, though now it seems to support X11 as well. Haven't used it myself yet (nor Wayland for that matter), so I have no idea how good (of a replacement on X) it is, however AFAIK it's the only such thing for Wayland.
use gtk_container_get_children on the menu-shell and iterate on the result to get the correct child
Any better way of getting the Bookmarks menu item other than getting the second last child of the menu-shell, or menu-item label (translatable, thus unusable I guess??)!?
If not, I got it partially* working by using the second to last child, so we can go with that, but ehh, it's not that great really (will need to be adapted to potential changes of menu items order):
children=gtk_container_get_children(GTK_CONTAINER(window->menubar));/* Get Bookmarks menu item (second to last) */menu_item=(g_list_nth_data(children,g_list_length(children)-3));g_signal_emit_by_name(children->data,"button-press-event",NULL,&ret);gtk_menu_shell_select_item(GTK_MENU_SHELL(window->menubar),menu_item);g_list_free(children);
*Partially, because the shortcut doesn't toggle the menu (doesn't close on 2nd press), just pops it up instead. I can't figure out what I'm missing or what makes the File menu/F10 behave (action manager??).
Also2, I wanted to add Ctrl+b shortcut for bmarks menu as well (as in Firefox), but that's used already for toggling the sidebar shortcuts view.
Ideas for another one, if any!? Ctrl+Shift+b perhaps?
If there's work being done to implement the various "Specialty Buttons" as KeyTweak refers to them, then should I also look into the keynames for the remaining ones that my keyboard lacked but KeyTweaks lists?
I have a few other older keyboard around with various extra buttons—maybe they'll have some of the remaining buttons that my keyboard lacks? (though I really don't think any of them have a "Shutdown" specialty button as I didn't even know that could even be a keyboard function as claimed by KeyTweak)
Most of the rest, as far as I'm aware of the ones existing, and as Alex already said, really belong to the system/session, not Thunar/File manager, and a few that could tend to be either already used or preset by users (eg. "My Computer"/"Home" could be set to open home directory in Thunar, but I'd normaly expect or set them to launch the file manager itself).
The only thing coming to mind would be to use "Stop" to stop the search if it's running?
If there's work being done to implement the various "Specialty Buttons"
...
I have a few other older keyboard around with various extra buttons—maybe they'll have some of the remaining buttons
Well, post whatever you find as long as it's applicable to Thunar/file manager in general and as long as the keyboard is not A4Tech KBS-8 (I have it and all the extra buttons on it are accounted for).
Any better way of getting the Bookmarks menu item other than getting the second last child of the menu-shell, or menu-item label (translatable, thus unusable I guess??)!?
You could keep a pointer to the menu-items as member variable of thunar.window, when the menu is created.
Also2, I wanted to add Ctrl+b shortcut for bmarks menu as well (as in Firefox), but that's used already for toggling the sidebar shortcuts view.
Ideas for another one, if any!? Ctrl+Shift+b perhaps?
If CTRL+B is already taken, I would rather not want to change the meaning of it.
The only thing coming to mind would be to use "Stop" to stop the search if it's running?
Sounds reasonable, though not sure anybody will ever use that one
The only other one I found on my physical keyboards that it recognized but wasn't assigned was Messenger (as in chat/instant messaging), but Messenger isn't assigned to anything by default even on Cinnamon and I don't think Xfce nor Thunar even has anything packaged by default that would be applicable.
I did notice however that Sleep wasn't working in Xfce by default despite working in Cinnamon by default...
I have no idea if "XF86Back" is the same thing, so perhaps someone more software-savvy could enlighten me if this is a duplicate? I did a search for "back" and nothing came up, so that's why I created this.