Score:0

Monitoring Mouse and Keyboard Usage

us flag

I am looking for an application to monitor keyboard and mouse usage on Ubuntu.

Keyboard usage could be defined as the difference between the first key press and the last key press. The last key press is when a key is pushed followed by a period of inactivity (e.g. 1 minute of non-usage). Total keyboard usage is therefore the sum of each duration of keyboard usage.

Mouse usage is similarly defined to keyboard usage. It is the difference between the first click and the last click, where the last click is a click followed by a period of inactivity. Total mouse usage is the sum of each duration of mouse usage.

Is there a package that has a similar ability to monitor keyboard and mouse usage?

pierrely avatar
cn flag
you could write your own script to monitor at intervals in a loop ... xinput --list for <ID>, then xinput query-state <ID> for mouse... for keyboard <ID> is trickier, test for key is up might work is your loop sleep 0.1 for every tenth of a second... see also xev but that seems to only to pertain to a window, but you could use xdotool getmouselocation ...some hints anyway and I just plucked this one for the keyboard https://www.tecmint.com/how-to-monitor-keyboard-keystrokes-using-logkeys-in-linux/
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.