Thread: How to invoke Apps, by Mapping Keyboard

  1. #1
    Registered User govi's Avatar
    Join Date
    Nov 2001
    Posts
    14

    How to invoke Apps, by Mapping Keyboard

    Hi All,

    From quite a few days, I have been trying to figure out, as to How do I go about coding a program which would enable me to launch applications at a press of a key....

    For Eg:- In Windows when we press F1 we get help ; F3=Find...

    In the sameway, I would like tode a program which would help me customise my keyboard.....

    Say, when I keyin 'E', IE window should pop up.....

    Any ideas......?
    govi

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Look up accellerator keys......

  3. #3
    Registered User govi's Avatar
    Join Date
    Nov 2001
    Posts
    14

    Unhappy

    I have not found anthing helpful in that site.....

    However afte doing some research, I have found out that I was actually heading in the wrong direction.....

    I have been able to write a Keyboard handler in 'C', which traps the interrupt 9. So that I can check the key which has been pressed, but now at this stage, I wanted to launch an application for that particular keystroke....

    I have also written a similar program in ASM, which checks for a
    particular keystroke & gives a beeping sound. I made this go memory resident (TSR). But this program seems to work only in the DOS window.... when I close the DOS window the program does not seem to work.

    So I guess I have to be coding a Windows TSR....

    Since Windows has its own keyboard buffer, and no DOS-based application can look at or modify the Windows keyboard
    buffer. So I would need to write a Windows-native application to do anything with Windows keystrokes.

    I don't have a clue as to how to go about doing this... Could someone help me please ?
    govi

  4. #4
    Registered User The15th's Avatar
    Join Date
    Aug 2001
    Posts
    125
    hi Govi;

    awhile back i wrote a program that traped all keystrokes from the user. it was awhile ago but off memory what you need to do is create two files, your .exe file and a .dll file. The dll has to be global and you need to use 'hooks'. there are a few good tutorials out there, so a search on google.com will help you.

    anyway this might not be the best way, but thats how i would go about it for now. just trap all keystockes between whatever values you want, and execute whatever program that key matches.
    arrh, i got nothing good to say.
    http://www.praxis1.vic.edu.au/home/dcola/

  5. #5
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    Goto msdn.

    Look up background services and key accelerators.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  6. #6
    Registered User govi's Avatar
    Join Date
    Nov 2001
    Posts
    14
    Toally CONFUSED[B] !!!

    I have been through the MSDN site, now I have got so much information, that I am totally lost... Now I don't know where to start off from...

    However these are my priorities :-

    1.) First write a Keyboard Handler....

    a.) Which would detect keypresses.....
    b.) Validate for the correct keypress..

    2.) Then write an Event Handler, to launch a application...

    3.) Lastly make it go Memory Resident...

    This is the first time, I would be trying to code a Windows Native Program....

    I don't know how I am going to do it, but I am determined to do it anyway..
    govi

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Detecting keyboard and mouse in linux
    By sameer.nalwade in forum C Programming
    Replies: 3
    Last Post: 11-22-2008, 04:24 AM
  2. Keyboard port using other that a keyboard
    By antoinelac in forum C++ Programming
    Replies: 4
    Last Post: 06-12-2008, 02:46 PM
  3. Virtual keys
    By Arkanos in forum Windows Programming
    Replies: 4
    Last Post: 12-12-2005, 10:00 AM
  4. Keyboard TAB Problem
    By Gary in forum Windows Programming
    Replies: 4
    Last Post: 02-24-2003, 09:12 PM
  5. Game Design Topic #2 - Keyboard or Mouse?
    By TechWins in forum Game Programming
    Replies: 4
    Last Post: 10-08-2002, 03:34 PM