Browse Source

add: list_pygames_vars, fix: pygame.MOUSEBUTTONDOWN

micha 6 months ago
parent
commit
345e5d8329
1 changed files with 12 additions and 2 deletions
  1. 12 2
      monitor/oszi_grid.py

+ 12 - 2
monitor/oszi_grid.py

@@ -52,12 +52,22 @@ import _thread as thread
 import sys
 font = pygame.font.SysFont("FreeSans", 12) #,color=(255,0,0))
 
+def list_pygame_vars():
+    for i in dir(pygame):
+        if i == i.upper(): # and "MOUSE" in i:
+            v=getattr(pygame,i)
+            print(":",i,v)
+            if v == 3:
+                print(":"*20 , i)
 
 NR = 0
 NR2 =0
 def read_event():
     global NR,NR2
     running = True
+
+    #list_pygame_vars()
+
     for event in pygame.event.get():
         if event.type == pygame.QUIT:
             running = False
@@ -69,8 +79,8 @@ def read_event():
 
 
         try:
-            print(event.dict ) #event.button)
-            if event.type == 5:
+            print("read_event:",event.dict,event.type ) #event.button)
+            if event.type in [5,pygame.MOUSEBUTTONDOWN]:
                 if "button" in event.dict and event.dict["button"] == 3:  #event.button)
                     NR += 1
                     if NR > 8: