custom Screensaver

A forum devoted to the discussion of all topics having to do with scripting and other advanced programming using iX Developer.
Post Reply
alialrikabi
Posts: 1
Joined: Thu Oct 31, 2013 9:58 am

custom Screensaver

Post by alialrikabi »

Hello;
i have QTERM-A7 and i want to make a custom screensaver. activated if there is no one touches the screen. let say a timer of 5 min. :geek: Thank you

User avatar
Chris T.
Posts: 109
Joined: Mon Nov 20, 2017 5:29 pm

Re: custom Screensaver

Post by Chris T. »

Hey alialrikabi,

The best way to do this would be to create a custom screen that you launch, after the inactivity timer reaches some number. You could create an inactivity script that opens the page after x time. Here is an inactivity script example:

namespace Neo.ApplicationFramework.Generated
{
using System.Windows.Forms;
using System;
using System.Drawing;
using Neo.ApplicationFramework.Tools;
using Neo.ApplicationFramework.Common.Graphics.Logic;
using Neo.ApplicationFramework.Controls;
using Neo.ApplicationFramework.Interfaces;


public partial class Inactivity_Script
{
private static System.Windows.Forms.Timer _timer;
private int _mouseX = -1;
private int _mouseY = -1;
private int _mouseMoved;

private void TimerTick(Object sender, EventArgs e)
{
var x = System.Windows.Forms.Control.MousePosition.X;
var y = System.Windows.Forms.Control.MousePosition.Y;

if( ( Math.Abs(_mouseX-x) > 5 ) || ( Math.Abs(_mouseY-y) > 5 ) )
{
_mouseMoved=0;
try
{
Globals.NetControl.EnableEthernet(1);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "Error!! Could not Resume Communications");
}
}
else
{
_mouseMoved++;

var inactivityTimeout = Globals.Tags.System_InactivityTimeBeforeLogout.Value;

if((inactivityTimeout>0) && (_mouseMoved > inactivityTimeout))
{
try
{
Globals.NetControl.DisableEthernet(1);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "Error!! Could not Halt Communications");
}
}
}
_mouseX = x;
_mouseY = y;
}

void Scriptmodule_Created(System.Object sender, System.EventArgs e)
{
// Set up timer that monitors if the mouse has moved
_timer = new System.Windows.Forms.Timer {Interval = 1000};
_timer.Tick += TimerTick;
_timer.Enabled = true;
}
}
}
Best regards,
Christopher
(801) 708-6690
Technical Support
Contact Us

Beijer Electronics AB
http://www.beijerelectronics.us

Post Reply