Menu

Use different settings for external keyboard?

2007-01-12
2013-01-02
  • Shaun Inman

    Shaun Inman - 2007-01-12

    I use a full-size Apple USB keyboard while at my desk but would love to remap my MacBook Pro's Enter key to be another Option key. I poked around a bit but didn't find an obvious way to maintain two different profiles, one for the built-in keyboard and another for my external USB keyboard. Did I miss it? If not, consider this a feature request ;)

     
    • James Mancini

      James Mancini - 2007-01-15

      In an older version, I thought I remember this being the default for that setting. Not sure when it changed, but I'd love to find a way to change it back!

       
    • James Mancini

      James Mancini - 2007-01-15

      Update: I got the code from the SVN repository and made the modifications. I'm not really a C programmer so this is a quick and dirty way to do it, but it worked like a champ.

      On line 71 of Substitute.cpp I added:

      if ( *keyboardType == 37 ) {

      and then on line 115, a close bracket:

      }

      This makes the "remap enter to X" functionality only apply to keyboard type 37 (MacBook Pro, officially called "POWERBOOKG4_2005_KEYBOARD").

      A cleverer or more motivated programmer would have probably done something different, but it worked. :-)

       
    • Jonathan Holst

      Jonathan Holst - 2007-01-26

      I've thought about this as well (I even emailed Michael to suggest it), and while it would be by far the best solution if DoubleCommand could detect the keyboard itself, it might be rather difficult. (Although I really don't know.)

      A temporary solution could be to allow you to save "templates" in where you've defined a number of checked fields, and then could be able to switch between them. That would be a great deal easier than the current state.

       
    • Sergio Ballestrero

      Having different "profiles" for different keyboards would also make it easy to use external "non Mac" keyboards with the portables - which is actually the reason that got me interested in DoubleCommand in the first place!

       
    • Jake

      Jake - 2007-04-20

      Sign me up for the ability to ONLY remap when an external keyboard is plugged in.

       
    • Martin

      Martin - 2007-06-12

      Me too!
      This would be a great great feature since I use a MacBook with a external USB PC keyboard.
      This means, "Win/Command" (internal) = "Alt" (USB) and "Command" (internal) = "Alt" (USB).
      Toggling both also toggles on the internal keyboard.
      It would be great it DoubleCommand could apply the settings only for the external Keyboard. (see also comment from mancini-netreo).

      I would assist but have absolutely no experience with MacOS development :(
      Martin

       
    • Neil

      Neil - 2007-06-24

      Me thrice!

      I'm using a Dinovo RF Notebook keyboard and ControllerMate with an MBP, but I'd like to be able to remap the 'Return' button on the MBP internal keyboard, whilst also doing the standard key swap on the Dinovo's Windows layout.

       
    • Michael Baltaks

      Michael Baltaks - 2007-07-02

      I've just commited code to subversion that gives the kext 4 separate settings, each with (optionally) it's own keyboard id. There's still work to do to hook this into the saved settings and then the preference pane, but it's on the way.

       
    • Solomon Matthews

      Make that four!

      This would be a fantastic feature, so much so it should be built into the OS itself.

       
    • Matthew Schinckel

      I'm using a MacBook Pro and an External keyboard, but I can't seem to figure out how to implement this 'different behaviours for different keyboards' thing.  I've tried using the *keyboardType == 37 trick from above, but both keyboards still give out a Forward Delete action instead of the Enter for the keypad on the external keyboard.

      Anyone else able to do this?

      (I've used different versions of the SVN code, and still no joy - I even found the version that had the same line numbers as James Mancini used, but no luck).

       
      • Michael Baltaks

        Michael Baltaks - 2008-02-13

        Just use the latest code from subversion, and then you will see that in addition to the dc.config sysctl variable there are numbered variable pairs starting with dc.keyboard1 and dc.config1. If you put a keyboard ID into dc.keyboard1, then the DoubleCommand config number in dc.config1 will only apply to the keyboard with that ID. I've allowed for 4 of these separate keyboard settings, I think that should cover most situations!

        So:

        sysctl -w dc.keyboard1=37
        sysctl -w dc.config1=131072

        The above will make backslash be a forward delete key, but only on a keyboard with ID 37. While this is in the kext already, exposing this all the way through the other layers up into the pref pane is work I haven't yet had time for.

        Hope that helps,
        -Michael.

         
    • kevin

      kevin - 2008-02-28

      ok.  i've built and am happily running DC from the latest svn image although i'm currently manually switching between configurations.  what i don't see (either in AboutThisMac or in the obvious places in the code—i'm probbably missing something less obvious—is how to figure out what keyboard ID i have so that i can configure things properly.  at the moment i have the built in mbp keyboard and an external logitech bluetooth cordless elite keyboard.  is there a simple way to figure out the magic keyboard ID value for these (or others later on)?

      thanks,
      ---K

       
      • Michael Baltaks

        Michael Baltaks - 2008-02-28

        You need to turn on debug output in the preference pane, then look at the file /var/log/system.log as you press a key. You'll see an entry for kbdType, the number that follows is your keyboard ID.

         

Log in to post a comment.