Closed dunland closed 3 years ago
I tried implementing "fine tuned keystoning" via shift+arrow keys.. but I don't quite get how to use pygame's key.get_pressed() function in that context:
key.get_pressed()
if calibration_mode: if event.key == K_TAB: active_anchor = 0 if active_anchor == 3 else active_anchor + 1 # rough keystoning: elif event.key in [K_UP, K_DOWN, K_RIGHT, K_LEFT] and pygame.key.get_pressed()[K_RSHIFT] == True: viewport.src_points[active_anchor][0] += 0.1 * (event.key == K_LEFT) - 0.1 * (event.key == K_RIGHT) viewport.src_points[active_anchor][1] += 0.1 * (event.key == K_UP) - 0.1 * (event.key == K_DOWN) # fine tuning holding shift: elif event.key in [K_UP, K_DOWN, K_RIGHT, K_LEFT] and not pygame.key.get_pressed()[K_RSHIFT]: viewport.src_points[active_anchor][0] += 1 * (event.key == K_LEFT) - 1 * (event.key == K_RIGHT) viewport.src_points[active_anchor][1] += 1 * (event.key == K_UP) - 1 * (event.key == K_DOWN)
this only works when NOT pressing K_RSHIFT
I also tried using different syntaxes, as you can see..
vielleicht auch einfach Zeit für Feierabend jetzt
maybe it should not even run in for event in pygame.event.get():
for event in pygame.event.get():
solved in 1de6857
I tried implementing "fine tuned keystoning" via shift+arrow keys.. but I don't quite get how to use pygame's
key.get_pressed()
function in that context:this only works when NOT pressing K_RSHIFT
I also tried using different syntaxes, as you can see..
vielleicht auch einfach Zeit für Feierabend jetzt