Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Can we define the Right control key as an ACCELERATOR in the resource file ?

Can we define the Right control key as an ACCELERATOR in the resource file ?

Scheduled Pinned Locked Moved C / C++ / MFC
questionlearning
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Maximilien
    wrote on last edited by
    #1

    We define accelerators in the resource file like this :

    IMB_MYAPP ACCELERATORS
    BEGIN
    "0", IDM_MY_ACTION, VIRTKEY, CONTROL, NOINVERT
    END

    This will let me use the ctrl-0 key to do "IDM_MY_ACTION". This only works for the left-control key; the right control-key does not work. Is there a way to define an accelerator for the right-control key in the resource or do I have to handle that in the code ? Thanks

    I'd rather be phishing!

    L 1 Reply Last reply
    0
    • M Maximilien

      We define accelerators in the resource file like this :

      IMB_MYAPP ACCELERATORS
      BEGIN
      "0", IDM_MY_ACTION, VIRTKEY, CONTROL, NOINVERT
      END

      This will let me use the ctrl-0 key to do "IDM_MY_ACTION". This only works for the left-control key; the right control-key does not work. Is there a way to define an accelerator for the right-control key in the resource or do I have to handle that in the code ? Thanks

      I'd rather be phishing!

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I have just tried this and it works with both left and right CTRL keys. It must be something to do with your system. [edit] If you look at the structure of an accelerator table (ACCEL structure (Windows)[^]) you can see that there is only a single value to represent either control key, [/edit]

      M 1 Reply Last reply
      0
      • L Lost User

        I have just tried this and it works with both left and right CTRL keys. It must be something to do with your system. [edit] If you look at the structure of an accelerator table (ACCEL structure (Windows)[^]) you can see that there is only a single value to represent either control key, [/edit]

        M Offline
        M Offline
        Maximilien
        wrote on last edited by
        #3

        Yeah, at first it did not work, but for some reason it works as expected.

        I'd rather be phishing!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups