How to make the computer think that a key has been pressed?
Posted: Mon Jan 15, 2007 4:43 pm
How can you make the computer think that a key has been pressed?
Discuss QBasic, Freebasic, QB64 and more
http://petesqbsite.com/phpBB3/
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?
Only works in pure DOS mode.comperr wrote:In QBasic you would have to use CALL ABSOLUTE to call proccesser interupts in assembaly.
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
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...?
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.
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.
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.
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?
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.