Announcement

Collapse
No announcement yet.

Detect user interaction and if none in a period of time do a page jump - please help!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Detect user interaction and if none in a period of time do a page jump - please help!

    Hi Folks

    The title says it all really.
    I have an app that has a few pages and i would like it to be able to return to a given page when there is no user interaction for a set amount of time.
    This is for an unmanned information kiosk and this would be the finishing touch.

    I just cant get my head around the input side of the code.

    Any help or pointers would be much appreciated.

    Thanks

    Alijos

  • #2
    Each page can have multiple timers and each page has on key and on mouse events so you would just start a timer then if a variable has not been changed because of a mouse move or key stroke have the timer jump page.

    Double click on a page then 'Script' then click Help for 'On Show' as thats where you start the timer and 'On Timer' as thats where you manage the timer then 'On Key/'On Mouse Button'/'On Mouse Move'/'On Mouse Wheel' as thats where you would set a variable to know if something has happened.

    So basically 'Global Functions' would have something like:
    Code:
    User_Interacted = 0;
    'On Show' of the page you would like to have monitored would have this:
    Code:
    Page.StartTimer(300000, 10);-- 300000 is 5 minutes in milliseconds.
    the 'On Time' would have something like this:
    Code:
    if e_ID == 10 then
     if User_Interacted == 0 then
      User_Interacted = 0;
      Page.Jump("Page1");
     end
    end
    and the on mouse and key events would just do something like this:
    Code:
    User_Interacted = 0;

    Comment


    • #3
      Code:
      if e_ID == 10 then
       if User_Interacted == 1 then
        User_Interacted = 0;
        Page.Jump("Page1");
       end
      end
      should read that, what is the purpose of disabling the edit option anyway?

      Comment


      • #4
        Grrrrr.........

        The last one should read this:

        Code:
        User_Interacted = 1;
        I give up, its a headache with no edit.

        Comment


        • #5
          Hi Shrek

          Thanks for taking the time to respond and for your help.

          Sorry to be such a noob, but is - User Interaction - an actual AMS command or do I need to set it as a Global Variable?
          And what actually does the user interaction monitoring?

          Again sorry for all the noob questions - but learning all the time !!!!

          Comment


          • #6
            Basically, in the "On Mouse Move" and "On Key" scripts are triggered any time the user moves the mouse or presses a key (respectively).

            "On Startup"
            Start a timer for the required amount of time (e.g. 5 mins).

            (Look up: Page.StartTimer)

            "On Mouse Move" and "On Key"
            Stop the timer and then start it again.

            (You guessed it: Page.StopTimer)

            "On Timer"
            Add some code that says if timer is triggered (i.e its been 5 mins since the user did anything) then Page.Jump


            The "On Startup" script can be found in your project explorer pane.

            The "On Mouse Move", "On Key" and "On Timer" scripts can be found by double clicking on your page then pressing Script.

            Note: The scripts that are located on the page will have to be put on every page that you want to be included in the inactivity page jump.

            Comment


            • #7
              Thanks Shrek & HobbsyJR
              I've got it working now - I think!!!!

              Alijos

              Comment

              Working...
              X