Send message question without diturbing the user

Post

Posted
Rating:
#1 (In Topic #1077)
Regular
monteiro is in the usergroup ‘Regular’
 Hi, guys.

I made a main form and and some other forms,  these ones always as modals.

My intention is setup a timer on Main form and, at random times, show a little modal form to the user , asking for some typing.
But I would like to not disturb the user if he/she is typing or moving the mouse.

Could I check this from the main form and not initiate the messaqe question form if the user is occupied?

Thanks for any ideas.

Online now: No Back to the top

Post

Posted
Rating:
#2
Guru
BruceSteers is in the usergroup ‘Guru’
probably easiest way is to use xprintidle but it won't work on wayland.

Code (gambas)

  1.  
  2. Shell "xprintidle" To sResult
  3.  
  4. If Val(RTrim(sResult)) > 3000 then
  5.   Print "idle more than 3 seconds"
  6.  


The gambas way..?? I do not know about Keyboard but it should be easy to test for Mouse movement…

Code (gambas)

  1.  
  2. Dim MouseX As Integer  = Mouse.ScreenX, MouseY As Integer = Mouse.ScreenY ' Note Mouse Pos
  3. Wait 1  ' wait one second
  4.  
  5. If MouseX <> Mouse.ScreenX Or If MouseY<> Mouse.ScreenY Then ' See if mouse has moved
  6. Print "Mouse has moved"
  7.  
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Guru
cogier is in the usergroup ‘Guru’
Well, here is my effort regarding this one, I hope it helps. This has not been tested on Wayland.

Attachment
Online now: No Back to the top

Post

Posted
Rating:
#4
Regular
monteiro is in the usergroup ‘Regular’
 Thank you.

I will test the ideas. Wayland is really a concern, as I don't know if the users will be using it;

Online now: No Back to the top
1 guest and 0 members have just viewed this.