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

  • From: Hedvig Jung <hedvig.jung@xxxxxxxxx>
  • To: ben@xxxxxxxxx, jacob.kruger.work@xxxxxxxxx, kperry@xxxxxxxxxxxxx, program-l@xxxxxxxxxxxxx
  • Date: Sat, 26 Nov 2022 16:11:51 +0100

I mean by outside of computer screen that
Mouse pointer is on edge of computer screen.

I would like to write Python program codes that
when I move mouse pointer with computer mouse on computer screen, then I can get
information color mode of a pixel, which is under the mouse pointer.
I would like ask color mode of a pixel in every second by moving mouse pointer.
But if the mouse pointer is on edge of the computer screen, then I
would like hear  a sound signal or
Windows alarm beep.

What do you think about it?
How can I write this Python program codes?
Which library can I use in this case?


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



On 11/25/22, Ben Mustill-Rose <ben@xxxxxxxxx> wrote:

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

** 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: