Difference between revisions of "Mouse input"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
(Created page with " <syntaxhighlight lang=python> if event.type == pygame.MOUSEBUTTONDOWN: if event.button == 1: # left click print("Left Click")...")
(No difference)

Revision as of 17:38, 22 February 2018

            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)