If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Hybrid View

Keyboard event

Hi,

I am trying to create a keyboard or mouse event in windows using vb, timed to recreate every minute or so. I was able to do this using the timer control and sendkeys function, and it works, but not with the results i was looking for. I need to actuallly imitate a real keypress or mouse click. To better understand what I need - i want to reproduce a mouse movement or keypress to prevent windows from initiating the screen saver. I actually want to run this on a desktop that I access through terminal services...the session will timeout if it detects inactivity after 1 minute or so, which is a real pain...the admin on this machine hasn't seen fit to fix this (or doesn't know how) and i don't have permission to change it myself, so i am hoping to write this little vb app that creates a timed keyboard mouse event at the hardware level.

Probably a mouse even (a movement of one pixel should do it) would probably better, this way the program can run in the background and wouldn't interfere when someone is actually using the machine (ie, unexpected keyboard output!)

i think i might have found what i am looking for - at least for keyboard events. i tested it locally and it worked - stopped my screen saver from coming on. i am testing it on the remote desktop now...its hard to say if it will work there because i don't fully understand how terminal services handles keyboard events remotely...