kmboxNET icon indicating copy to clipboard operation
kmboxNET copied to clipboard

how to get cursor position | come ottenere la posizione del cursore

Open ignevade opened this issue 2 years ago • 4 comments

hello, I would like to know if there is (or if you would be able to add) a function which allows me to get the current x and y coordinate positions of the mouse connected to the kmbox so that I can fully control the kmbox with my second computer. thank you!

ciao, vorrei sapere se esiste (o se potresti aggiungere) una funzione che mi permette di ottenere le attuali posizioni delle coordinate xey del mouse collegato al kmbox in modo da poter controllare completamente il kmbox con il mio secondo computer. Grazie!

ignevade avatar May 13 '24 09:05 ignevade

def posA(self):
    x1=win32api.GetCursorPos()[0]
    y1=win32api.GetCursorPos()[1]      
    return int(x1), int(y1)

def posR(self):
    screen_width, screen_height = self.get_screen_size()
    x1,y1 = win32api.GetCursorPos()[0],win32api.GetCursorPos()[1]
    x = -(screen_width / 2 - x1) if x1 < screen_width / 2 else x1 - screen_width / 2
    y = -(screen_height / 2 - y1) if y1 < screen_height / 2 else y1 - screen_height / 2
    return int(x), int(y)        

##posA=ABSOLUTE POSITION ##posR=RELATIVE POSITION

ZCban avatar May 14 '24 16:05 ZCban

I know, but I want to get it using the kmbox as I am controlling the kmbox from my second computer and not the one which the kmbox is connected to.

ignevade avatar May 14 '24 18:05 ignevade

backtoback2814 discord

ZCban avatar May 14 '24 20:05 ZCban

added! username is @kentyandayo

ignevade avatar May 16 '24 12:05 ignevade