Preventing Screensaver activation via Java

Discussion in 'Java' started by Peter Pfeiffer, Apr 29, 2005.

  1. Just wonder if there is a way to run some java based program to "fool" a
    Windows PC into thinking there was some activity which would keep the
    screensaver from activating.
    I know it's a wide open question and somewhat naive, but some thoughts
    would be welcome.

    Thanks,

    pj
     
    Peter Pfeiffer, Apr 29, 2005
    #1
    1. Advertising

  2. Peter Pfeiffer

    Bill Tschumy Guest

    On Thu, 28 Apr 2005 22:46:24 -0500, Peter Pfeiffer wrote
    (in article <k6ice.665762$>):

    > Just wonder if there is a way to run some java based program to "fool" a
    > Windows PC into thinking there was some activity which would keep the
    > screensaver from activating.
    > I know it's a wide open question and somewhat naive, but some thoughts
    > would be welcome.
    >
    > Thanks,
    >
    > pj


    Don't know if it would work, but you cold try using java.awt.Robot to either
    move the mouse a couple of pixels (probably a bad idea) or to generate a
    non-typing key event (like pressing the Shift key). I think the Robot hooks
    into the system at a level that may reset the screen saver timer.

    --
    Bill Tschumy
    Otherwise -- Austin, TX
    http://www.otherwise.com
     
    Bill Tschumy, Apr 29, 2005
    #2
    1. Advertising

  3. Bill Tschumy wrote:
    >
    >
    > Don't know if it would work, but you cold try using java.awt.Robot to either
    > move the mouse a couple of pixels (probably a bad idea) or to generate a
    > non-typing key event (like pressing the Shift key). I think the Robot hooks
    > into the system at a level that may reset the screen saver timer.
    >


    Thanks, it works on a Mac (10.3.9) and on a PC (Windows Pro2000).
    Just used the Shift key ID and called both keyPressed(int) and
    keyReleased(int) methods via a timer. The spec does say Robot class is
    subject to the OS's security setup:
    > Note that some platforms require special privileges or extensions to access low-level input control.



    --pj
     
    Peter Pfeiffer, May 4, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marine
    Replies:
    3
    Views:
    23,678
    Marine
    Feb 15, 2006
  2. Alexandra Suciu

    Account activation via email

    Alexandra Suciu, Sep 1, 2003, in forum: HTML
    Replies:
    9
    Views:
    879
    Greg Schmidt
    Sep 2, 2003
  3. Andrew T.

    Most Java ScreenSaver?

    Andrew T., May 3, 2006, in forum: Java
    Replies:
    1
    Views:
    2,345
    Remon van Vliet
    May 3, 2006
  4. Replies:
    0
    Views:
    480
  5. java_killer

    Making a Screensaver with Java

    java_killer, May 9, 2008, in forum: Java
    Replies:
    3
    Views:
    1,758
    Arne Vajhøj
    May 12, 2008
Loading...

Share This Page