Hi Bruce,

I am sorry, but I'm lost. I have some ideas myself on how to handle the problem which the app has to solve, but, if you have the time, the only way I'll understand precisely what you're trying to do is for you to write up the entire app for my study. smile

Thanks,

Rod

On 4/23/14 9:08 AM, LB wrote:
Hi Rod,
     I left that there and commented it out. But, the reset would have to be in 
both a key up and the timer call, inside the key movement itself, but since you 
are inserting the tab key in the queue then there is only one need for reset, 
after the shift tab or what a person has done themselves.
     In other words you do a key up event and place inside that event call the 
reset command so the timer starts all over again for the next 10 minutes or 15. 
I would think a 10 minute timer would be smarter for you can not trust your own 
provider, let alone the other provider...
     I had placed 30 minutes in as just an example not for real.

     Remember there are 2 key up events and only one monitors or gives key 
values, processed, but with this routine it does not matter which one to use...
     my_KeyUpConnection = ConnectEvent( Keyboard, "OnKeyProcessedUp", 
"OnKeyProcessedUp")
     MainDialogProc = True
     Exit Function
Sub OnKeyProcessedUp( ky, md)
     'Only if you want to know what key was processed.
  Disconnect my_KeyUpConnection
  my_KeyUpConnection = 0
  Queue "ResetTimer", globalTimerVal
End Sub

         Bruce


Sent: Tuesday, April 22, 2014 11:33 PM
Subject: Re: An app which prevents merchant service logout


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




---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com




Reply via email to