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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. I still DO NOT UNDERSTAND keyboard accelerators

I still DO NOT UNDERSTAND keyboard accelerators

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorial
4 Posts 3 Posters 1 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.
  • B Offline
    B Offline
    BoudewijnEctor
    wrote on last edited by
    #1

    Hi, Does anyone know a good tutorial on keyboard accels, or does anyone want to give sime kind of lesson about it (like a checklist or something). My problem is like this: I have an app wich shows pictures, this works. But every time a user presses the right-arrow button, the app needs to show a new picture (this is done by calling showNextPicture()). I've already build showNextPicture(), but I can't build the link between the key and the function. PS I'm using a dialog based app, with MFC support Thanks for reading this!

    T 1 Reply Last reply
    0
    • B BoudewijnEctor

      Hi, Does anyone know a good tutorial on keyboard accels, or does anyone want to give sime kind of lesson about it (like a checklist or something). My problem is like this: I have an app wich shows pictures, this works. But every time a user presses the right-arrow button, the app needs to show a new picture (this is done by calling showNextPicture()). I've already build showNextPicture(), but I can't build the link between the key and the function. PS I'm using a dialog based app, with MFC support Thanks for reading this!

      T Offline
      T Offline
      Terry ONolley
      wrote on last edited by
      #2

      Look at PreTranslateMessage() and TranslateMessage() in your docs. It will point you to where you can determine what key was pressed and from there what handler to call.


      Have you answered an MTQ? Check out the stats!


      B 1 Reply Last reply
      0
      • T Terry ONolley

        Look at PreTranslateMessage() and TranslateMessage() in your docs. It will point you to where you can determine what key was pressed and from there what handler to call.


        Have you answered an MTQ? Check out the stats!


        B Offline
        B Offline
        BoudewijnEctor
        wrote on last edited by
        #3

        OK, I've read it, But Is still don't understand what exactly I've got to do with those messages etc. can you explain that to me?

        S 1 Reply Last reply
        0
        • B BoudewijnEctor

          OK, I've read it, But Is still don't understand what exactly I've got to do with those messages etc. can you explain that to me?

          S Offline
          S Offline
          Steve S
          wrote on last edited by
          #4

          Add a menu option like ID_SHOW_NEXT, make this call your function, then map the arrow key to your menu option in the accelerator resource. Steve S

          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