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,** To leave the list, click on the immediately-following link:-
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