Mouse input

From TRCCompSci - AQA Computer Science
Revision as of 17:38, 22 February 2018 by Admin (talk | contribs) (Created page with " <syntaxhighlight lang=python> if event.type == pygame.MOUSEBUTTONDOWN: if event.button == 1: # left click print("Left Click")...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
            if event.type == pygame.MOUSEBUTTONDOWN:
                if event.button == 1: # left click 
                    print("Left Click")
                elif event.button == 3: # right click shrinks radius 
                    print("Right Click")
            
            if event.type == pygame.MOUSEMOTION:
                # if mouse moved, get the position 
                print(event.pos)