How to make the computer think that a key has been pressed?
How to make the computer think that a key has been pressed?
How can you make the computer think that a key has been pressed?
Evan Hurd
Re: How to make the computer think that a key has been press
You can do this in QB by using INKEY$ or ON KEY.Evan wrote:How can you make the computer think that a key has been pressed?
But you should expalin in more detail what you need or want to do.
Regards..... Moneo
-
- Veteran
- Posts: 399
- Joined: Wed Mar 02, 2005 9:01 pm
- Location: Nashville, Tennessee
- Contact:
-
- Veteran
- Posts: 399
- Joined: Wed Mar 02, 2005 9:01 pm
- Location: Nashville, Tennessee
- Contact:
Re: How to make the computer think that a key has been press
He made a post about a keylogger before... So I'm guessing he wants to make a program that gets a key (before the OS does), record it, and then pass it to the OS. That way, you have a "keylogger". Records every key pressed, without the knowledge of a more advanced user.moneo wrote:You can do this in QB by using INKEY$ or ON KEY.Evan wrote:How can you make the computer think that a key has been pressed?
But you should expalin in more detail what you need or want to do.
Regards..... Moneo
Is that right...?
-
- Coder
- Posts: 45
- Joined: Sun Nov 26, 2006 2:00 pm
- Location: Champaign, Illinois
Re: How to make the computer think that a key has been press
That shneakyshneaky Evan.Patz QuickBASIC Creations wrote:He made a post about a keylogger before... So I'm guessing he wants to make a program that gets a key (before the OS does), record it, and then pass it to the OS. That way, you have a "keylogger". Records every key pressed, without the knowledge of a more advanced user.moneo wrote:You can do this in QB by using INKEY$ or ON KEY.Evan wrote:How can you make the computer think that a key has been pressed?
But you should expalin in more detail what you need or want to do.
Regards..... Moneo
Is that right...?
Maybe I'm wrong, but I don't think the keys would register if the program was running in the background, even if it's reading them directly from the keyboard port, at least in WinXP or something. It might work in a dos based os like Win95, but I'm still not sure.
Maybe QB isn't the right tool for the job.
sid6.7 wrote:everytime i see your avatar i want to scream and kill it....
Re: How to make the computer think that a key has been press
You would need to use the GetAsyncKeyState API call, it picks up keystates whether the parent application has focus or not. But I don't think that that's what he's looking for...it looks more like what he wants is a program that enters keystrokes by itself, in which case, SendKeys will do the job.seaBiscuit$ wrote:Maybe I'm wrong, but I don't think the keys would register if the program was running in the background, even if it's reading them directly from the keyboard port, at least in WinXP or something. It might work in a dos based os like Win95, but I'm still not sure.
Maybe QB isn't the right tool for the job.
-
- Coder
- Posts: 45
- Joined: Sun Nov 26, 2006 2:00 pm
- Location: Champaign, Illinois
Re: How to make the computer think that a key has been press
Is it possible to use Windows API calls in QB? I'm thinking that maybe writing something in C that can be called with SHELL or piped through the QB program might work for that.Nekrophidius wrote:You would need to use the GetAsyncKeyState API call, it picks up keystates whether the parent application has focus or not. But I don't think that that's what he's looking for...it looks more like what he wants is a program that enters keystrokes by itself, in which case, SendKeys will do the job.
sid6.7 wrote:everytime i see your avatar i want to scream and kill it....
Re: How to make the computer think that a key has been press
No, it's not.seaBiscuit$ wrote:Is it possible to use Windows API calls in QB?
What might help is if you state your true intentions rather than dancing around the mulberry bush, know what I mean?seaBiscuit$ wrote:I'm thinking that maybe writing something in C that can be called with SHELL or piped through the QB program might work for that.
-
- Coder
- Posts: 45
- Joined: Sun Nov 26, 2006 2:00 pm
- Location: Champaign, Illinois
Re: How to make the computer think that a key has been press
I'm not actually going to try this, if that's what you mean. I'm busy with my own projects as well as school. I was just suggesting a method that might work.Nekrophidius wrote:What might help is if you state your true intentions rather than dancing around the mulberry bush, know what I mean?
sid6.7 wrote:everytime i see your avatar i want to scream and kill it....
-
- Coder
- Posts: 45
- Joined: Sun Nov 26, 2006 2:00 pm
- Location: Champaign, Illinois
-
- Veteran
- Posts: 399
- Joined: Wed Mar 02, 2005 9:01 pm
- Location: Nashville, Tennessee
- Contact:
- Seb McClouth
- Veteran
- Posts: 342
- Joined: Wed Nov 09, 2005 7:47 am
- Location: Inside the Matrix...
- Contact:
Hey Patz, not sure if I can be of any help but pm me about this. We'll see what's possible!Patz QuickBASIC Creations wrote:Well, as I wouldn't use this as a keylogger or whatever, I am still curious as to what you would have to do. I want to make a "virtual keyboard" program for my TUI.
Grtz
Seb
QBinux is a Linux distribution with the aim of integrating the work of the vast community of free software developers at Pete's QBASIC Site in order to create a modern, performant, safe and easy to use system for system administrators and desktop users.
- burger2227
- Veteran
- Posts: 2466
- Joined: Mon Aug 21, 2006 12:40 am
- Location: Pittsburgh, PA
You can OUT a key value using &H60 on 98 and older machines. XP will not allow changes to settings in the BIOS keyboard including lites.
Try the following to get the key press and release codes.
Do: press$ = INKEY$
code = INP(&H60)
locate 20, 20: PRINT press$; code
LOOP UNTIL press$ = CHR$(27)
The release code is 128 more than the press code. Numbers Lock may mess up the shift and arrow key codes returned however. If both shift keys = 170 then change the numbers lock mode. I have a list of many DOS BIOS routines. Just email me with DOS BIOS in message!
Try the following to get the key press and release codes.
Do: press$ = INKEY$
code = INP(&H60)
locate 20, 20: PRINT press$; code
LOOP UNTIL press$ = CHR$(27)
The release code is 128 more than the press code. Numbers Lock may mess up the shift and arrow key codes returned however. If both shift keys = 170 then change the numbers lock mode. I have a list of many DOS BIOS routines. Just email me with DOS BIOS in message!