Hi Bruce,
Okay, I must be thick here, but I can't see how the
Keyboard.WaitForAllKeysUp will be reset should the person decide to use
the keyboard during the 15-minute wait interval after which the
keystrokes are sent. We have to write it in such a way that the app
starts over checking to ensure that the keyboard has been left alone and
then immediately start the timer once again.
Thanks,
Rod
On 4/22/14 10:47 PM, LB wrote:
Hi Again,
I changed it to reflect what I said and forgot about no parens if calling
a sub.
Bruce
Sent: Tuesday, April 22, 2014 10:43 PM
Subject: Re: An app which prevents merchant service logout
Hi Rod,
Yes, or have a radio selection, in either case it could be done inside the
Timer val global variable and inside a sub call convert it to miliseconds, so
the initial values remains the same and sent in as a ByVal only to insure no
changes in it externally.
Dim globalTimer: globaltimer = 0
Dim globaltimerVal: globalTimerVal = 30 'Minutes
ResetTimer globalTimerVal
Sub ResetTimer( ByVal timerVal)
If globaltimer > 0 Then
StopTimer globalTimer
globalTimer = 0
End If
' Convert time to milliseconds.
timerVal = timerVal * 60 * 1000
globalTimer = StartTimer( timerVal, "DoTab" )
End Sub
Sent: Tuesday, April 22, 2014 10:30 PM
Subject: Re: An app which prevents merchant service logout
Hi Bruce,
I want to include an input box so that he can choose the time interval;
he figures he's logged out in about 20 minutes. Also, it seems to me
that I could write it in such a way that the AllKeysUp would start the
timer, and let's say we set it to 15 minutes. This way, he could work
away at his computer all he wants, and, as soon as he stops typing for
15 minutes, the keystrokes go off to keep him logged in to his merchant
service.
Thanks,
Rod
On 4/22/14 10:12 PM, LB wrote:
Hi Rod,
OK, now the reset of the timer can be placed in a keyup routine so it can
be reset and also the initial value can be a constant all through it, or
converted to milliseconds from minutes at the start and just used all the time,
unless a time interval needs changing.
So this gives the bare bones and sub call for the timer, and the rest is
where you set up the init for the timer and reset of it.
Bruce
Sent: Tuesday, April 22, 2014 10:00 PM
Subject: Re: An app which prevents merchant service logout
Hi Bruce,
I love it. That's the ticket! smile
I can't think of much room for improvement. The Tab and Shift-Tab
hadn't occurred to me as very safe keys to use.
This is pretty much a copy and paste, my friend. smile
Still, though, I welcom all input from everyone. smile
Thanks so much,
Rod
On 4/22/14 9:45 PM, LB wrote:
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
---
This email is free from viruses and malware because avast! Antivirus protection
is active.
http://www.avast.com
---
This email is free from viruses and malware because avast! Antivirus protection
is active.
http://www.avast.com
---
This email is free from viruses and malware because avast! Antivirus protection
is active.
http://www.avast.com