Keyboard Input override?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Keyboard Input override?

  1. #1
    Join Date
    Aug 2008
    Posts
    15

    Keyboard Input override?

    Hey, I would like to know if it is at all possible to try and completely override the normal microsoft keyboard input function... As in...

    I would like to create a C/C++ program which, when run, will change certain keys to others...

    Example:

    User inputs 'A' ( On any random application or process he has running )
    My program changes 'A' to 'B'
    Microsoft inserts 'B' to wherever 'A' would have been placed

    If anyone already knows of an application that already does this and is very simple/easy, I have no problem with using an already made one... But, I would not mind working/learning to try and code this puppy...

    For your information, this is not for any type of virus/keylogger... The reason I would like it is because I use a Dvorak keyboard...

    Because dvorak isn't popular, I would have to switch a windows option which most computers ( like the one at my college ) don't let me do... So, I would like to make a simple application to just intercept these keys and change them to whatever the one for dvorak needs to be...

    The programming is extremely simple from my perspective, the only problem I see is if Windows tries to have security on it or something... Which, I'm sure that it does but I'm hoping there is a way around it or something ><.

    Any form of help is wanted!! I am honestly OK with having to learn assembly if I need to, but my desired result is not something that will change BIOS or cause any long-term effects, I would like it to only convert keys while my application is running and then nobody will even know once I turn off my app...

    Thanks, fmwyso

  2. #2
    Join Date
    Jan 2009
    Posts
    35

    Re: Keyboard Input override?

    You should take a look at AutoIT. It's a programming language for windows, which contains functions to set hotkeys and to send keys to an application. So, to switch 'A' to 'B', the code would look something like this:

    Code:
    HotKeySet("A","aPressed")
    HotKeySet("{ESC}","exit")
    
    While True
    WEnd
    
    Func aPressed()
    Send("B")
    EndFunc
    
    Func exit()
    Exit
    EndFunc
    Make sure you look at the help file before you start. AutoIT's homepage is: http://www.autoitscript.com .

  3. #3
    Join Date
    Apr 2004
    Posts
    102

    Re: Keyboard Input override?

    Quote Originally Posted by fmwyso View Post
    Because dvorak isn't popular, I would have to switch a windows option which most computers ( like the one at my college ) don't let me do...
    If you are in the U.S. I suggest you talk to the IT department about unlocking the the Regional and Language Options control panel. Even DoD (most horribly draconian IT you'll ever encounter) doesn't lock that one out. Why? Alternate keyboard layouts need to be available due to the Americans with Disabilities Act (ADA). If it's your college, you can also argue that it would help students in foreign language classes (I can't imagine trying to compose a document in a foreign script using Character Map).

  4. #4
    Join Date
    Aug 2008
    Posts
    15

    Re: Keyboard Input override?

    Quote Originally Posted by jefranki View Post
    If you are in the U.S. I suggest you talk to the IT department about unlocking the the Regional and Language Options control panel. Even DoD (most horribly draconian IT you'll ever encounter) doesn't lock that one out. Why? Alternate keyboard layouts need to be available due to the Americans with Disabilities Act (ADA). If it's your college, you can also argue that it would help students in foreign language classes (I can't imagine trying to compose a document in a foreign script using Character Map).
    I was unaware of it was a part of the ADA, if I'm unable to get this to work I will probably go have a talk with my teacher... ( My teacher used to be an IT guy there and is a friend ^_^ )...

    I'm not really sure if they intentionally blocked it out or honestly what is wrong with it... I can go to regional, I can go to my keyboard and I can add the keyboard in... The problem I have is that when I change it to Dvorak default, it doesn't actually change the keyboard layout ><... I'm not really sure if it is a vista bug or if it is a block they put so people wouldn't mess around with the option just for fun... I'm honestly really glad to know that it is in the ADA, for a while I thought that I wouldn't have anything to prove they need to add the functionality in :P.

    I'm gunna take a look at AutoIt ( It looks like fun ^_^ ) and thanks for the post...
    Last edited by fmwyso; March 11th, 2009 at 03:12 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center