Ok, figured out workaround that does pretty much what I want:
win32api.GetLastInputInfo()

That seems to return time stamp of last user interaction, including mouse 
moving, clicking, keyboard input, app switching, etc.

stay well

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

  ----- Original Message ----- 
  From: Jacob Kruger 
  To: python-win32@python.org 
  Sent: Tuesday, 18 February, 2014 9:59 PM
  Subject: [python-win32] win32gui cursor position tracking etc.


  Firstly, I know the following can retrieve mouse cursor position coordinates 
easily enough:

  import win32gui
  tPos = win32gui.GetCursorPos()

  But, while something like .GetCursorInfo looks promising, I am struggling to 
find more info about what the first two returned items are - one of them seems 
to be an integer which almost matches the same value you get returned using 
just .GetCursor(), but, the main thing is while the mouse cursor coordinates 
are useful, etc., the main thing I actually want to be able to retrieve at this 
stage is the current position/coordinates of either the currently focused item, 
or the keyboard/PC cursor - as in, for example, if your mouse is hovering 
higher up on screen, but, lower down you're typing text in some or other text 
box, etc., and, primary issue is that I would prefer to just be able to track 
the cursor itself, since the control elements/interface the user may be 
involved in using will be a separate piece of software, etc. - as in, I 
actually want to do something more along the lines of double checking if the 
computer is in active use, and, while am pretty sure wouldn't be able to 
intercept keystrokes - don't want to- but something similar to being able  to 
easily track position/coordinates of mouse cursor is what am trying to 
implement, and issue is also that for example with forms of accessibility 
software like my screenreader, I might at times not really use the mouse cursor 
for quite a while at all, since I primarily just navigate whole operating 
system using cursor and tab keys, along with keyboard invocation of menu 
systems, control shortcut keys, etc..

  Suggestions?


  Jacob Kruger
  Blind Biker
  Skype: BlindZA
  '...fate had broken his body, but not his spirit...'



------------------------------------------------------------------------------


  _______________________________________________
  python-win32 mailing list
  python-win32@python.org
  https://mail.python.org/mailman/listinfo/python-win32
_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to