My Apple Keyboard VK_KEYS

My Apple Keyboard VK_KEYS

Postby Jim » Thu Jan 06, 2011 6:15 pm

Here's a shot of the keyboard I have with the VK_ keys labeled. Just want to compare notes.

My version of Key Tool (prints keycodes including VK_ constants.)
(Menu: Plugins/Key Codes)



Small Map

0
Last edited by Jim on Thu Jan 06, 2011 7:23 pm, edited 4 times in total.
Hi

Jim 
Global Moderator
 

Re: My Apple Keyboard VK_KEYS

Postby Jim » Thu Jan 06, 2011 6:17 pm

Just noticed the Numpad 'enter' key reports different values on Down and Up - (13 and 3)

TIG noted the onKeyDown method of a Tool class does not indicate the tab key being pushed.
0
Hi

Jim 
Global Moderator
 

Re: My Apple Keyboard VK_KEYS

Postby Dan Rathbun » Thu Jan 06, 2011 7:01 pm

When you hold down SHIFT and hit the option key... do you get VK_ALT ?
0
    I'm not here much anymore. But a PM will fire email notifications.
    User avatar
    Dan Rathbun 
    PluginStore Author
    PluginStore Author
     

    Re: My Apple Keyboard VK_KEYS

    Postby Dan Rathbun » Thu Jan 06, 2011 7:07 pm

    I tried that on my PC. When I press ALT it says VK_MENU.

    Is this little tool cross-platfrom ?
    0
      I'm not here much anymore. But a PM will fire email notifications.
      User avatar
      Dan Rathbun 
      PluginStore Author
      PluginStore Author
       

      Re: My Apple Keyboard VK_KEYS

      Postby Jim » Thu Jan 06, 2011 7:10 pm

      No, I get 2 actions one for each keypress in the order I press them. I haven't been able to trigger a VK_ALT on either system.


      I might add the constraint, copy, and alt masks to the key tool.
      0
      Hi

      Jim 
      Global Moderator
       

      Re: My Apple Keyboard VK_KEYS

      Postby Dan Rathbun » Thu Jan 06, 2011 7:23 pm

      It needs work...
      1) a class var KeyTool.@@instance to hold the handle.
      2) a use() class method that conditionally either calls new() or gets the instance if the tool is already loaded.
      3) the menu item needs to call the JF::KeyTool.use() method.
      4) a menu validation proc that properly checks the menuitem activate and deactivate

      Currently clicking the menu item, does not really stop the tool.
      EDIT: (It actually creates a new instance.) PM'd you an updated file with the changes above.
      0
      Last edited by Dan Rathbun on Fri Jan 07, 2011 1:02 am, edited 2 times in total.
        I'm not here much anymore. But a PM will fire email notifications.
        User avatar
        Dan Rathbun 
        PluginStore Author
        PluginStore Author
         

        Re: My Apple Keyboard VK_KEYS

        Postby Jim » Thu Jan 06, 2011 8:48 pm

        VK_ALT == VK_MENU == VK_COMMAND == 18

        It's just that VK_MENU won out in the Hash conflict. (so a problem in my keytool.)
        0
        Hi

        Jim 
        Global Moderator
         

        Re: My Apple Keyboard VK_KEYS

        Postby driven » Thu Jan 06, 2011 9:52 pm

        hi Jim,

        I've got an apple wireless keyboard, and just tested the keycodes, can't find home yet but will do a mock up of all the variants, that require using the fn() key...

        cheers

        john
        0
        learn from the mistakes of others, you may not live long enough to make them all yourself...

        driven 
        PluginStore Author
        PluginStore Author
         

        Re: My Apple Keyboard VK_KEYS

        Postby Jim » Thu Jan 06, 2011 10:06 pm

        Thanks John.

        fn() key?



        On Windows, using VK_DELETE, VK_PRIOR, and VK_NEXT, I am only getting results from onKeyUp. Nothing at all from onKeyDown.
        0
        Hi

        Jim 
        Global Moderator
         

        Re: My Apple Keyboard VK_KEYS

        Postby driven » Fri Jan 07, 2011 12:33 am

        apple_fn-keycodes.jpg


        only onKeyUp for prior and next...
        0
        learn from the mistakes of others, you may not live long enough to make them all yourself...

        driven 
        PluginStore Author
        PluginStore Author
         

        Re: My Apple Keyboard VK_KEYS

        Postby driven » Fri Jan 07, 2011 1:04 am

        you can also change to other languages layouts and try them...
        apple_KeyboardViewer.jpg
        0
        learn from the mistakes of others, you may not live long enough to make them all yourself...

        driven 
        PluginStore Author
        PluginStore Author
         

        Re: My Apple Keyboard VK_KEYS

        Postby Dan Rathbun » Fri Jan 07, 2011 1:06 am

        This is kinda weird. While the KeyTool was active, I had a face selected (prior to activating the tool,) and when I pressed the DELETE key, the face was deleted.

        Perhaps the tool should clear the selection ?

        Wonder what other things might happen via Shortcuts when the tool is active ?
        0
          I'm not here much anymore. But a PM will fire email notifications.
          User avatar
          Dan Rathbun 
          PluginStore Author
          PluginStore Author
           

          Re: My Apple Keyboard VK_KEYS

          Postby driven » Fri Jan 07, 2011 1:15 am

          all the shortcut keys, SU and system just carry on working and don't register in the console at all, here at least
          0
          learn from the mistakes of others, you may not live long enough to make them all yourself...

          driven 
          PluginStore Author
          PluginStore Author
           

          Re: My Apple Keyboard VK_KEYS

          Postby driven » Fri Jan 07, 2011 1:24 am

          onKeyUp : Key code: 127 using standard apple back-delete
          onKeyUp : Key code: 63272 ( VK_DELETE ) using fn(key)+standard apple back-delete
          NO onKeyDown for delete
          0
          learn from the mistakes of others, you may not live long enough to make them all yourself...

          driven 
          PluginStore Author
          PluginStore Author
           

          Re: My Apple Keyboard VK_KEYS

          Postby Dan Rathbun » Fri Jan 07, 2011 1:49 am

          driven wrote:all the shortcut keys, SU and system just carry on working and don't register in the console at all, here at least

          The DELETE key registered "onKeyUp : Key code: 46 ( VK_DELETE )" in the Console (on my PC,) and deleted the selected face.

          It seems weird that keys would bubble up from a Tool instance keytrap callback. I can see having a bubble method that allows passing the key up to Sketchup, but to do it all the time?
          0
            I'm not here much anymore. But a PM will fire email notifications.
            User avatar
            Dan Rathbun 
            PluginStore Author
            PluginStore Author
             

            SketchUcation One-Liner Adverts

            by Ad Machine » 5 minutes ago



            Ad Machine 
            Robot
             



             

            Return to Developers' Forum

            Who is online

            Users browsing this forum: No registered users and 5 guests

            Visit our sponsors: