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




Reply via email to