import
pygame
from
pygame.
locals
import
*
from
sys
import
exit
pygame.init()
size
=
width, height
=
740
,
480
screen
=
pygame.display.set_mode(size)
img
=
pygame.image.load(
"char.png"
).convert()
clicking
=
False
right_clicking
=
False
middle_click
=
False
while
True
:
mx, my
=
pygame.mouse.get_pos()
location
=
[mx, my]
for
event
in
pygame.event.get():
if
event.
type
=
=
pygame.QUIT:
exit()
if
event.
type
=
=
MOUSEBUTTONDOWN:
if
event.button
=
=
1
:
clicking
=
True
img
=
pygame.image.load(
"char1.png"
)
pygame.display.update()
if
event.button
=
=
3
:
right_clicking
=
True
img
=
pygame.image.load(
"char.png"
)
pygame.display.update()
if
event.button
=
=
2
:
middle_click
=
middle_click
img
=
pygame.transform.scale(img, (
100
,
100
))
pygame.display.update()
if
event.
type
=
=
MOUSEBUTTONUP:
if
event.button
=
=
1
:
clicking
=
False
screen.fill((
255
,
255
,
255
))
screen.blit(img, (location[
0
], location[
1
]))
pygame.display.update()