Allow configuration of ctrl+w keyboard shortcut (close channel) #397

Open
JakobOvrum opened this Issue Feb 4, 2013 · 16 comments

6 participants

@JakobOvrum

This can be quite annoying as browsers often use the same shortcut to close tabs.

After a short search I wasn't able to find the relevant source, hence this report. I wouldn't mind doing this myself if I was more familiar with the code.

@TingPing
hexchat member

src/fe-gtk/menu.c#L1626
That's the code to edit but this is a common complaint so maybe...

@Benguin

Just bumping this a little, since I just reinstalled hexchat and started noticing this again. This is a lot more important for dvorak users, where the V key is adjacent to the W key, meaning that a finger slip during a copy/paste will close the channel you were going to paste to.

@TingPing
hexchat member

The easy approach to this would be to just remove the hard coded ones and add them to our already existing customizable keybindings the issue with this approach is that all existing configs would lack the very neccessary keybindings such as closing hexchat... So I really don't know of a worthy solution.

@Benguin

In the meantime could you link me to the place in the code where the hotkey for it is set? I don't think https://github.com/hexchat/hexchat/blob/master/src/fe-gtk/menu.c#L1626 still points to it.

@TingPing
hexchat member

@Benguin just ctrl+f for GDK_w

@Benguin

Ah, thanks. I'm not a coder so I didn't know what to search for heheh.

@hxe
hxe commented Mar 6, 2014

being able to change ctrl+q would also be nice. ive accidentally closed hexchat too many times and its the most annoying thing that can happen lol

@saiyr

How about making ctrl-w/q do a prompt "Are you sure you want to ____?" with a "Don't ask me again" checkbox?

@TingPing
hexchat member

How about making ctrl-w/q do a prompt "Are you sure you want to ____?" with a "Don't ask me again" checkbox?

It does for quit (are you people even using the same client?)...
These are common bindings that people should expect though.

HexChat Quit Prompt

@TingPing
hexchat member

Also I wrote this script a while back for somebody to add ctrl+shift+t keybinding to undo close tab like web browsers: https://github.com/TingPing/plugins/blob/master/HexChat/undoclose.py

@Benguin

I think he means for when you're only closing a channel, not closing the entire client. Common binding or not, having control+W be non-configurable screws some people not using a QWERTY layout (for instance, with DVORAK, W is adjacent to V, and control+V is a really commonly used keybinding and hitting W instead is all too easy.)

@TingPing
hexchat member

think he means for when you're only closing a channel

That's why my reply was to a specific users comment.

@hxe

/set gui_quit_dialog on
lol
didn't even know that existed, i must have told it not to ask again ages ago

@saiyr

Sorry TingPing, I only also mentioned Ctrl-Q because others did. Ctrl-W is the only one that bothers me. I understand that they're both common shortcuts. The reason I accidentally close channels a lot is because opening links (in Chrome, on Xubuntu 12.04) raises the Chrome window, but does not actually take focus. So if I want to Ctrl-W the opened link, it closes the channel instead, unless I explicitly focus the window first. So you could say that this bug is a bandaid, but I'm not familiar enough with windowing systems to know how to fix the other issue or whose fault it even is.

@TingPing
hexchat member

Ok well just so people can stop bumping this old issue I'll say that menu.c will not be touched by me until (if ever) HexChat is on Gtk3, they have much improved ways for handling key-bindings there.

I want better key-binding customization but the current implementation is garbage, sorry.

@aoloe

sorry, i don't really see the interest of being able to create an empty channel with ctrl-n and closing the current channel with ctrl-w.

the context menu in the channel list and /close are imo more than good enough.
(the first one for those who join channels with the mouse, the second one for those who know about the irc command like /join: seriously: i can type faster `/join? than i can press ctrl-w!).

i would suggest to simply remove both shortcuts (and, once you have gtk-3 you can let people who want the two shortcuts add them...)

adding a confirmation dialog might help... but i'm not sure that it's really needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment