How to detect idle keyboard in DOSbox?

Using applications, configuring, problems
Post Reply
Message
Author
hansol
Posts: 23
Joined: Sat 23 Nov 2013, 01:55

How to detect idle keyboard in DOSbox?

#1 Post by hansol »

Hi guys,

This isn't a puppy-specific question, but everyone here at the forum is just so damn helpful I thought why not throw this out there.

Specifically, what I need is a script that measures the time between keyboard activity, and after 3 minutes of no keys being pushed, kicks out a message saying that the user has been inactive.

A little background: I'm using dosbox to run some legacy software for my business. Additionally, I run a time and billings system (gnotime) that I use specifically because it detects idle-time. However, it seems that whenever dosbox is active, the OS itself will not detect idle time. Originally I thought it was a billings software-specific issue, so I as a remedy I wrote an idle-detect script that kicks out a gxmessage after 3 minutes of system idle time. The script (and gnotime) work perfectly in detecting idle time when dosbox isn't running. However, as soon as dosbox is engaged, neither gnotime or the idle script function correctly, and no idle-time is recognized.

My workaround (in theory) is to somehow write a script that tracks the time between keyboard inputs. After 3 minutes of keyboard inactivity, a gxmessage will be generated. I've done some serious googling in the interim, but was hoping maybe some of the smarter minds here could at least help narrow down what command or commands I could use to create this keyboard-idle script. -Hansol

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#2 Post by mikeb »

It might be worth trying dosemu to see if it behaves better.
Its ported from freedos and I always found it friendlier than dosbox. Only a suggestion but it might help

mike

hansol
Posts: 23
Joined: Sat 23 Nov 2013, 01:55

#3 Post by hansol »

Mike,

I actually did attempt to use dosemu, and (ironically) it played nice with the regular idle-detect. The trouble was it wouldn't play nice with the legacy software: it would run it, but the software could not correctly access the data folders. In fact it wouldn't even register the directories as existing. However, if you accessed the folders directly through the dosemu prompt, they could be found clear as day. This lead me to believe it's an "emulated legacy software" problem, and not a dosemu problem.

It was that result that led me to trying to come up with some sort of workaround involving keyboard inputs, but so far no luck. I'm hopeful google will come up with something in the next day or so.

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#4 Post by disciple »

Have you searched for keylogging software? That might get you going in the right direction.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#5 Post by Flash »

There is also a program called xdotool, which may or may not be any help. It's available as a .pet somewhere here in the forum.

Post Reply