[program-l] Re: question about mouse with sound function

  • From: Ben Mustill-Rose <ben@xxxxxxxxx>
  • To: program-l@xxxxxxxxxxxxx
  • Date: Fri, 25 Nov 2022 21:48:58 +0000

What do you mean by outside computer screen? Visually speaking a
cursor won't move beyond the screen, so do you mean outside of the
currently focused window?

On 11/25/22, kperry@xxxxxxxxxxxxx <kperry@xxxxxxxxxxxxx> wrote:

Not sure if this will work for you but it did oon my screen resolution and
touch pad.

import wx, time

app = wx.App()
width, height = wx.GetDisplaySize()
print (f"{width}, {height}")
while True:
    time.sleep(1) # wait 5 seconds
    x,y=wx.GetMousePosition()
    if x<0 or x>=width or y<0 or y >=height:
        print ("\a")
    else:
        print (f"x={x},y={y}")

-----Original Message-----
From: program-l-bounce@xxxxxxxxxxxxx <program-l-bounce@xxxxxxxxxxxxx> On
Behalf Of Hedvig Jung
Sent: Friday, November 25, 2022 2:33 PM
To: jacob.kruger.work@xxxxxxxxx; program-l@xxxxxxxxxxxxx
Subject: [program-l] Re: question about mouse with sound function


I would like to give you a feedback about above mentioned program codes.
I installed wx library from pypi.
I moved mouse pointer on computer screen and I runned below mentioned
program codes.
When mouse pointer was outside of computer screen, then I didn't hear
Windows alarm beep.


#start code

import wx, time

app = wx.App()

while True:
    time.sleep(5) # wait 5 seconds
    print(str(wx.GetMousePosition())) # this prints out the X and Y
coordinates of the current mouse cursor position

# end code



How can I modify this program code, that I can hear Windows alarm beep, if
the mouse pointer is outside of the computer screen and there is no pixel
under the mouse pointer?

Which other library or which other software can I install that I can hear
Windows alarm beep if the mouse pointer is outside of the computer screen?
What is your idea for it?


      Thank you very much for your help and for your answer in advance!
      Hedvig



On 11/23/22, Hedvig Jung <hedvig.jung@xxxxxxxxx> wrote:
      Hello,

I am Hedvig.

I use Python 3.8 programming language in Windows 10.
I work on PyCharm with
JAWS for Windows reading program.

I would like to use such a sound signal, if mouse pointer goes outside
of my computer screen, then I can hear a sound signal.

I would like to use a sound signal,
if there is no pixel under the mouse pointer and the mouse pointer is
outside of my computer screen, then I can  hear a sound signal.

I would like to ask you,
which Python program codes can I run that I can hear this sound signal
if the mouse pointer is outside of the computer screen?

Which Windows application can I use that I can hear this sound signal
if the mouse pointer is outside of computer screen?

Or what kind of other solution exists that I can hear this sound signal?

I would like to kindly ask you to send me please your answer to my
private e-mail address.

My private e-mail address:
hedvig.jung@xxxxxxxxx


      Thank you very much for your help and for your answer in advance!
      Kind regards,
      Hedvig

** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq

** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq

** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq

Other related posts: