Rod,
Try something like this below. Now the timer can be set at any time, like
when the last key is up, and reset each time a key is pressed. Now you can pick
something else but a tab might go to the next control and reversing it would
bring it back. Don't know because I do not know his system that he is on-line
with.
Bruce
Dim globalTimer: globaltimer = 0
Dim timerVal: timerVal = 30 'Minutes
If globaltimer > 0 Then
StopTimer globalTimer
globalTimer = 0
End If
' Convert time to milliseconds.
timerVal = timerVal * 60 * 1000
globalTimer = StartTimer( timerVal, "DoTab" )
Sub DoTab()
' Keyboard.WaitForAllKeysUp()
Keyboard.InsertKey vk_Tab
Sleep 1000
Keyboard.InsertKey vk_Tab, kmShift
End Sub
Sent: Tuesday, April 22, 2014 9:04 PM
Subject: An app which prevents merchant service logout
Hi,
A We user who is running a business is looking for a way of avoiding
being logged out by one of his merchant service providers. It seems
that if there is no keyboard activity for 20 minutes or so, he is logged
out, which is inconvenient for him. I suggested that I could write an
app for him, but I was wondering what would be the safest approach to
take in creating the routine to send a single character, what character
would be best, and how to implement it. Obviously, there would be a
timer, and I can write this with no problem. The ideas I have in mind are:
Have a timer running, and execute the Keyboard.WaitForAllKeysUp()
command every minute to ensure that the monitored time begins only after
this is checked, and then the keystroke is sent after, say, 15
iterations, that is, there has been no keyboard activity for 15 minutes,
in which case the keystroke is sent.
I want to send only the Control key to avoid sending something more
complex which might cause problems.
Well, that's about all I can think of reight now, and I certainly
appreciate your ideas, including specific lines of code. smile
Much thanks,
Rod
---
This email is free from viruses and malware because avast! Antivirus protection
is active.
http://www.avast.com