Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable keyboard shortcuts (selectively) #1974

Closed
kytrinyx opened this issue Aug 13, 2014 · 17 comments
Closed

Disable keyboard shortcuts (selectively) #1974

kytrinyx opened this issue Aug 13, 2014 · 17 comments

Comments

@kytrinyx
Copy link

@kytrinyx kytrinyx commented Aug 13, 2014

Is there a way to selectively remap or disable shortcuts?

In almost all the software I use, the key combination control-h (^h) acts as delete. I haven't used backspace for years (and I avoid stack-overflow and other sites where ^h is remapped to mean something else, because it's so incredibly frustrating to type when every typo triggers something rather than deleting stuff).

@stuconnolly
Copy link
Member

@stuconnolly stuconnolly commented Aug 23, 2014

Shortcuts can be changed in OS X's System Preferences under Keyboard.

@kytrinyx
Copy link
Author

@kytrinyx kytrinyx commented Aug 23, 2014

Thanks!

@kytrinyx
Copy link
Author

@kytrinyx kytrinyx commented Sep 4, 2014

I have not figured out how to do this.

I tried looking for existing mappings in System Preferences > Keyboard > Shortcuts
I looked everywhere, but in particular expected to find something under "App Shortcuts".

I unclicked the existing shortcut for "All Applications > Show Help Menu", even though that was mapped to something other than ^-h, but this did not change the behavior of the app.

Since there was nothing there, I also tried adding a new shortcut for Sequel Pro to match the "MySQL Help" menu item, hoping that it would overwrite the existing one, but this did not help either.

annoying-sequelpro-help

@abhibeckert
Copy link
Member

@abhibeckert abhibeckert commented Sep 5, 2014

I've been able to confirm this, the Control-H keyboard shortcut is not using a menu item so it cannot be changed via System Preferences.

I didn't know about ^h... but I use ^d and others all the time and will also be working ^h into my workflow. Thanks!

@abhibeckert abhibeckert reopened this Sep 5, 2014
@dmoagx
Copy link
Member

@dmoagx dmoagx commented Sep 5, 2014

Actually ^H has a menu item (it's in the context menu of the query editor) but yeah, reassigning doesn't work.
bildschirmfoto 2014-09-05 um 10 32 59 260

@abhibeckert
Copy link
Member

@abhibeckert abhibeckert commented Sep 5, 2014

We have "MySQL Help" in the Help menu, I think we should add "MySQL Help for Word" to the Help menu as well, and put the shortcut there.

Also I suspect the NSTextView subclass is actually the one looking for the ^H keypress? Haven't checked... but if so, we could just remove that once there is a help for word menu item.

@kytrinyx
Copy link
Author

@kytrinyx kytrinyx commented Sep 5, 2014

I didn't even realise there was a context menu for the query editor, that makes sense.

Thanks for taking the time to dig into this, @abhibeckert

abhibeckert added a commit that referenced this issue Sep 6, 2014
Resolve #1974:  Allow un-mapping of Ctrl-H
@abhibeckert
Copy link
Member

@abhibeckert abhibeckert commented Sep 6, 2014

@kytrinyx Shortly there will be a new nightly build (http://nightly.sequelpro.com/) with a menu item in the Help menu that you can change the shortcut of.

Note it has two titles, depending whether any text is currently selected in the editor. So you need to define it twice, like this:

screen shot 2014-09-06 at 2 22 58 pm

@kytrinyx
Copy link
Author

@kytrinyx kytrinyx commented Sep 6, 2014

I'm so excited about this. Thanks so much for fixing it!

@kytrinyx
Copy link
Author

@kytrinyx kytrinyx commented Sep 8, 2014

It works beautifully.

@thisiswei
Copy link

@thisiswei thisiswei commented May 4, 2015

@kytrinyx @abhibeckert Awesome! I just ran into the same problem, what do I need to do to remap ^H to delete?

@kytrinyx
Copy link
Author

@kytrinyx kytrinyx commented May 4, 2015

@thisiswei if you get the nightly build then you need to change the two shortcuts listed above (help for word, help for selection). Once those are defined to be something other than ^h, then ^h for deletion will work.

@thisiswei
Copy link

@thisiswei thisiswei commented May 4, 2015

@kytrinyx Great! Do you experience any problems with the nightly build?

@kytrinyx
Copy link
Author

@kytrinyx kytrinyx commented May 5, 2015

@thisiswei No I update regularly and have never experienced any problems.

@thisiswei
Copy link

@thisiswei thisiswei commented May 5, 2015

@kytrinyx Great!

@twlz0ne
Copy link

@twlz0ne twlz0ne commented Feb 17, 2016

defaults write com.sequelpro.SequelPro NSUserKeyEquivalents '{
    "MySQL Help for Selection" = "@^h";
    "MySQL Help for Word" = "@^h";
    "back-word" = "^h";
}'
@killrazor
Copy link

@killrazor killrazor commented Apr 30, 2020

Came here to find ⌘ + return to execute a query (like MySQL Workbench).

Found that I can map using mac Key bindings with the names of Run Current Query and Run Previous Query.

If you want to do it how @twlz0ne suggested it would be:

 defaults write com.sequelpro.SequelPro NSUserKeyEquivalents '{
        "Run Current Query" = "@\\U21a9";
        "Run Previous Query" = "@\\U21a9";
    }'

Note: you may have to restart the app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.