The Source for Java Technology Collaboration
User: Password:



Tim Boudreau

Tim Boudreau's Blog

NetBeans now has Mac-friendly key bindings

Posted by timboudreau on September 08, 2004 at 01:37 PM | Comments (7)

I just committed some changes to NetBeans key bindings handling, so that mac users will get key bindings that are much more like other mac apps (no change for Windows or Linux users).

Specifically what's different:

  • Ctrl -> Command - everything that normally maps to Ctrl will use the Command key instead, except where that's impossible (Command-H always hides the app, Command-Q always quits, Command-~ always changes windows, that sort of thing)
  • Command-G maps to Find-Next
  • Command-R maps to Replace (Ctrl-H, the windows key binding, works as well)
  • Cursor control keys in the editor are the default mac ones - Option-Left-arrow to skip to next word, etc. (Option==Alt)

Also, dialog buttons will now appear in the correct order on Macs, with OK on the right.

Alas, these changes will not be in NetBeans 4.0 Beta 2 - I missed the cut-off, but it's better to review things properly than to rush. They will be in Beta 3.

Please give it a try, and let me know if any of your habitual keystrokes are doing the wrong thing. You can download tonight's build here. Be sure to select "Daily" from the "Build Type" drop-down.

The build with these changes will become available just after 4PM PST, or 1AM GMT.


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • F11 and other build keys
    while you are at it, can you map 'Build' to another key. F11 fires expose, which is nice, but does not get the job done ;)

    Thanks

    Posted by: lucasjordan on September 09, 2004 at 07:49 AM

  • changing the game...
    Just yesterday I stumbled across work on freedesktop.org on sharing global key bindings:
    http://www.freedesktop.org/Standards/default-keys-spec

    nice idea; instead of having apps follow CUA-style key-binding guidelines, have them look up common named bindings, in a shared config. If other apps worked this way, the win/mac keybinding switch would have been trivial; once again a problem solved by adding another level of indirection.
    http://c2.com/cgi/wiki?ButlerLampson

    This cant come too soon for me. I loathe working with TextPad's default bindings on other devs machines (F5 is search??) and just this week I repeatedly typed Ctrl-X Ctrl-S (save, in emacs) in IDEA (where it means delete line, then save)...with hilarious consequences...

    Posted by: ba22a on September 09, 2004 at 08:17 AM

  • Emacs bindings pleeeease...
    I've been looking for ages for emacs key bindings
    for netbeans. I can do some basic ones through
    the options panels, but I'd really like emacs cursor
    movement, search, and cut/paste bindings.

    Has anyone done this?

    -- cary

    Posted by: cobrien on September 09, 2004 at 02:09 PM

  • changing the game...
    Interesting stuff.

    Keybindings, especially cross-platform ones, are a surprisingly hard problem - first you have things like Command vs. Control on mac vs. pc; then you have key bindings that different window managers consume on unices; then you have key bindings that work in some, but not all locales (for example, Norwegian keyboards bind Alt-8 to a bracket, so if your app uses that, suddenly the user can't type brackets anymore).

    It seems to be one of those ugly problems where general solutions don't work, and you really just have to handle a bunch of overlapping special cases in a reasonable way, which is not exactly fun to code.

    Posted by: timboudreau on September 10, 2004 at 05:08 AM

  • Emacs bindings pleeeease...
    Well, there is an actual XEmacs integration that replaces NetBeans editor - externaleditor.netbeans.org.

    Emacs keybindings *should* actually be semi-doable - at least for the editor, which can handle multi-key bindings. There is no multi-key binding support for menu accelerators (Ctrl-x-s might be difficult to implement); this may change in the future. But it's certainly possible to get it more emacs-like, and the cursor control stuff wouldn't be hard. The ide/applemenu module could serve as inspiration - it is how the mac bindings are done, and it's possible to have a module provide overrides of all of the default keybindings.

    Posted by: timboudreau on September 10, 2004 at 05:12 AM

  • i noticed the key bindings had suddenly changed too - thanks Tim, things like this really alter the way people perceive a bit of software the first time they see it. It's really off-putting as a mac user to have to go through the hundreds of key bindings every time i upgraded netbeans, and a first time user will just get confused and frustrated.

    I agree with the other poster about the function keys though - several of the current bindings still map to expose keys or (even more awkard) the f6 key which, on my powerbook, switches the keyboard over to a number pad - very confusing !

    j

    Posted by: jportway on December 19, 2004 at 05:12 AM

  • My suggestion for the powerbook and function keys is to go into System Settings | Keyboard and check the checkbox "Use the F1-F12 keys for custom actions". That will make function keys work normally on your powerbook (you'll need to hold down the fn key to use them to adjust display brightness/volume/etc.). Or adjust to using the fn key with all function keys to make them do what they should. Personally, I checked the checkbox a long time ago and definitely prefer it that way - others may not, but since it has a workaround (just hold down the fn key to use function keys in an application), it'd probably be overkill to try to find alternate bindings for all the function key bindings in NetBeans.

    Anyway, hope that helps. I seem to recall the first version of Mac OS that I used didn't have a setting for making the function keys work (or maybe I just missed it), so maybe you didn't run across the setting either.

    Posted by: timboudreau on December 20, 2004 at 08:11 AM





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds