Thread: Need Help on Remapping Keyboard Keys (C++)

  1. #1
    Registered User
    Join Date
    Mar 2011
    Posts
    1

    Lightbulb Need Help on Remapping Keyboard Keys (C++)

    I have one keyboard that is compatible with both Mac and Windows. However, the command key is two keys to the left of where it is on the normal Apple keyboard and another special key is in its place.

    I would like to write a program in C++ that a keyboard user could run in order to digitally/virtually switch the position of the keys, so that the special key serves the function of the command key and vice versa.

    However, I am a Java guru--I need some help getting starting on this project in C++, since C++ allows a global remapping of keys where as Java requires a window to be active.
    I would like to write the program myself rather than use a googled program. I also need the program to be compatible with Mac.

    Thank you very much,
    Grace
    Last edited by GraceLC; 03-14-2011 at 05:23 PM.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    > since C++ allows a global remapping of keys
    No it doesn't.
    Standard C++ only knows about standard streams of characters. It doesn't care what is injecting symbols into that stream.

    So whatever you do come up with will be specific to your OS. You might be able to write SOME common code in standard C++, but you won't be able to write ALL of it.

    Such a thing would be best done in the keyboard driver of whatever OS you're using.

    > I also need the program to be compatible with Mac.
    Sounds like you're going to end up with two keyboard drivers.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C program to press keyboard keys
    By meadhikari in forum Windows Programming
    Replies: 9
    Last Post: 03-26-2010, 12:36 AM
  2. Simulate Keys with a Keyboard Hook
    By guitarist809 in forum Windows Programming
    Replies: 3
    Last Post: 11-14-2008, 08:14 PM
  3. advanced lock/unlock keys on keyboard
    By fbs777 in forum Linux Programming
    Replies: 0
    Last Post: 09-22-2008, 08:54 PM
  4. Arrow keys as keyboard Input
    By bradleym83 in forum C++ Programming
    Replies: 3
    Last Post: 12-01-2005, 09:39 PM
  5. Selecting Menu using keyboard arrow keys
    By darkmessiah in forum C Programming
    Replies: 5
    Last Post: 06-07-2005, 11:07 AM