Computer Science Canada (Detecting Keystrokes When Window is not Active) and (Making an Invisible Window) |
Author: | HRI [ Tue Sep 14, 2010 10:14 am ] |
Post subject: | (Detecting Keystrokes When Window is not Active) and (Making an Invisible Window) |
A little project of mine has led me to wanting to find out if there's any possible way of a running program to detect keystrokes when the program's window is not currently active. Also, when writing to a text file, is there any way to write one character at a time, but not make them go down the page rather than across, else only one appears? Here's an example: Type "abc" File: either (c) or (a b c) I want: (abc) It seems that if I try to just go across the page, every character overwrites the one that was there, unless it's on a new line. Also, is there any way to make the program run with no window? I tried opening a window to start and closing it right after, but then it just opens a regular window to use. I am using Turing 4.1.1a Let me know if you need more info. |
Author: | andrew. [ Tue Sep 14, 2010 11:04 am ] |
Post subject: | RE:(Detecting Keystrokes When Window is not Active) and (Making an Invisible Window) |
I don't think you can do that in Turing. The Turing window must be active for keystrokes to register. |
Author: | Insectoid [ Tue Sep 14, 2010 11:22 am ] | ||||
Post subject: | RE:(Detecting Keystrokes When Window is not Active) and (Making an Invisible Window) | ||||
to put extra characters on the same line just use and ellipse after the first put statement.
which will output
|
Author: | HRI [ Tue Sep 14, 2010 7:10 pm ] |
Post subject: | Re: (Detecting Keystrokes When Window is not Active) and (Making an Invisible Window) |
Ok, thank you. As for the same line thing...*palmface* I was confused after not programming in Turing for so long in conjunction with being tired :/ Do you have any idea what language can record keystrokes when it is not active, as well as not having a window open to run in? In case you're wondering, this is an experiment within my own computer. |
Author: | Insectoid [ Tue Sep 14, 2010 7:29 pm ] |
Post subject: | RE:(Detecting Keystrokes When Window is not Active) and (Making an Invisible Window) |
It will always have to be active, though Turing records keystrokes even when it's out of focus and it doesn't need to have a run window. If you don't 'put' anything, you won't get a run window. Use Input.KeyDown() to record keys. It returns a value representing every keypress (a binary figure I think, though I may be wrong). If you want it to be (almost) completely invisible (ie doesn't show up in the taskbar) you'll want to use another language that can run as a process rather than an application. I dunno specifics, 'cause I don't run Windows, but it's entirely possible that compiled languages won't show up in the taskbar at all by default. Though if this is your goal, I suspect you're trying to write a keylogger in which case I'm not going to say more. |
Author: | DtY [ Tue Sep 14, 2010 8:07 pm ] |
Post subject: | Re: RE:(Detecting Keystrokes When Window is not Active) and (Making an Invisible Window) |
Insectoid @ Tue Sep 14, 2010 11:22 am wrote: ellipse Ellipsis, an ellipse is a shape |
Author: | TheGuardian001 [ Wed Sep 15, 2010 1:44 am ] |
Post subject: | Re: RE:(Detecting Keystrokes When Window is not Active) and (Making an Invisible Window) |
Insectoid @ Tue Sep 14, 2010 7:29 pm wrote: It will always have to be active, though Turing records keystrokes even when it's out of focus and it doesn't need to have a run window. If you don't 'put' anything, you won't get a run window. Use Input.KeyDown() to record keys.
Input.Keydown also opens a window (as does getchar, getch, and get.) There is no way to capture input without having an active and visible window. This functionality was explicitly removed from Turing (There's an error for it if you try using a window hidden with Window.Hide) |
Author: | andrew. [ Wed Sep 15, 2010 3:52 pm ] |
Post subject: | RE:(Detecting Keystrokes When Window is not Active) and (Making an Invisible Window) |
I don't know about other languages, but you can probably do it in Java or C++. I know that in Java, you can have it simulate keystrokes to the active application by using the Robot class. |
Author: | mirhagk [ Wed Sep 15, 2010 8:14 pm ] |
Post subject: | RE:(Detecting Keystrokes When Window is not Active) and (Making an Invisible Window) |
if you're making any sort of virus/keylogger kind of thing, don't use Turing, while it is easy to use, it simply gives you too many restrictions (because it's developed for high school students, they remove any chance to make malware programs, so that you never learn the skill) |
Author: | millerbell [ Tue Aug 20, 2013 5:42 am ] |
Post subject: | Re: RE:(Detecting Keystrokes When Window is not Active) and (Making an Invisible Window) |
Insectoid @ Tue Sep 14, 2010 7:29 pm wrote: It will always have to be active, though Turing records keystrokes even when it's out of focus and it doesn't need to have a run window. If you don't 'put' anything, you won't get a run window. Use Input.KeyDown() to record keys. It returns a value representing every keypress (a binary figure I think, though I may be wrong).
If you want it to be (almost) completely invisible (ie doesn't show up in the taskbar) you'll want to use another language that can run as a process rather than an application. I dunno specifics, 'cause I don't run Windows, but it's entirely possible that compiled languages won't show up in the taskbar at all by default. Though if this is your goal, I suspect you're trying to write a keylogger in which case I'm not going to say more. If you want to monitor how many times each individual key is pressed, you will need to set up an array to hold the counts. |