a
|
After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 70 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 53 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
@@ -2,7 +2,7 @@ import copy
|
|||||||
import pygame
|
import pygame
|
||||||
|
|
||||||
class MeinSpiel:
|
class MeinSpiel:
|
||||||
bilder = ["Bilder/Schach.jpg","Bilder/stern.jpg","Bilder/motiv1.jpg","Bilder/motiv2.jpg","Bilder/motiv3.jpg","Bilder/motiv4.jpg","Bilder/motiv5.jpg","Bilder/motiv6.jpg","Bilder/motiv7.jpg","Bilder/motiv8.jpg"]
|
bilder = ["Bilder/Schach.jpg","Bilder/stern.jpg","Bilder/motiv1.png","Bilder/motiv2.png","Bilder/motiv3.png","Bilder/motiv4.png","Bilder/motiv5.png","Bilder/motiv6.png","Bilder/motiv7.png","Bilder/motiv8.png"]
|
||||||
spielfeld = []
|
spielfeld = []
|
||||||
|
|
||||||
def __init__(self, felderX, felderY):
|
def __init__(self, felderX, felderY):
|
||||||
@@ -28,4 +28,33 @@ class MeinSpiel:
|
|||||||
for i in range(0, 11, 5):
|
for i in range(0, 11, 5):
|
||||||
print(i)
|
print(i)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
from pynput import mouse
|
||||||
|
|
||||||
|
# Callback-Funktion bei Mausklick
|
||||||
|
def on_click(x, y, button, pressed):
|
||||||
|
if pressed:
|
||||||
|
print(f"Mausklick gedrückt bei Position ({x}, {y}) mit Taste {button}")
|
||||||
|
else:
|
||||||
|
print(f"Mausklick losgelassen bei Position ({x}, {y}) mit Taste {button}")
|
||||||
|
|
||||||
|
# Callback-Funktion bei Mausbewegung
|
||||||
|
def on_move(x, y):
|
||||||
|
print(f"Maus bewegt zu Position ({x}, {y})")
|
||||||
|
|
||||||
|
# Callback-Funktion beim Mausrad-Scrollen
|
||||||
|
def on_scroll(x, y, dx, dy):
|
||||||
|
print(f"Mausrad bewegt bei Position ({x}, {y}) – Delta: ({dx}, {dy})")
|
||||||
|
|
||||||
|
# Listener starten
|
||||||
|
with mouse.Listener(
|
||||||
|
on_click=on_click,
|
||||||
|
on_move=on_move,
|
||||||
|
on_scroll=on_scroll
|
||||||
|
) as listener:
|
||||||
|
print("Maus-Event-Listener gestartet. Beenden mit STRG+C.")
|
||||||
|
listener.join()
|
||||||