Results 1 to 4 of 4

Thread: Mimicing Keyboard events using _asm in C++

  1. #1

    Thread Starter
    College Grad!!! Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,300

    Mimicing Keyboard events using _asm in C++

    I'm wanting to work with a low level function in C++ that mimics keyboard strokes without the user pressing the keyboard to any active, or possible inactive windows. I don't know much on Assembly, but I have the function set up to use later on for a DLL file once I have the code:

    Code:
    int _stdcall Send_Keys(unsigned char Key, int *hWnd)
    {
         //hWnd is a handle to a Window.
    
         _asm{
    
              //assembly source code here
    
         }
    
         return 1;
    }
    Can anyone help me out?

  2. #2
    Hyperactive Member Maven's Avatar
    Join Date
    Feb 2003
    Location
    Greeneville, TN
    Posts
    322

    Re: Mimicing Keyboard events using _asm in C++

    Quote Originally Posted by Jacob Roman
    I'm wanting to work with a low level function in C++ that mimics keyboard strokes without the user pressing the keyboard to any active, or possible inactive windows. I don't know much on Assembly, but I have the function set up to use later on for a DLL file once I have the code:

    Code:
    int _stdcall Send_Keys(unsigned char Key, int *hWnd)
    {
         //hWnd is a handle to a Window.
    
         _asm{
    
              //assembly source code here
    
         }
    
         return 1;
    }
    Can anyone help me out?

    You'll have to use the windows API to do that and there will not be much gain even if you do it in asm.
    Education is an admirable thing, but it is well to remember from time to time that nothing that is worth knowing can be taught. - Oscar Wilde

  3. #3

    Thread Starter
    College Grad!!! Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,300

    Re: Mimicing Keyboard events using _asm in C++

    That's the thing though. The API's such as SendInput and keybd_event doesn't control programs that use DirectX's DirectInput.

  4. #4
    Hyperactive Member Maven's Avatar
    Join Date
    Feb 2003
    Location
    Greeneville, TN
    Posts
    322

    Re: Mimicing Keyboard events using _asm in C++

    The problem is that you cannot generate interrupts from ASM when your programming in 32 bit protected mode. That pretty much means we are forced to do things the windows way.

    I'm thinking that direct input must read from the device driver directly. So you'll have to search msdn to figure out how to deal with that situation. You may end up having to have a device driver.
    Education is an admirable thing, but it is well to remember from time to time that nothing that is worth knowing can be taught. - Oscar Wilde

Posting Permissions

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



Click Here to Expand Forum to Full Width