Skip to content

Commit

Permalink
[WIP] doublick selects entry in selector. TBD: last mouse_clickin a d…
Browse files Browse the repository at this point in the history
…ouble-click 'spills' to the Screen
  • Loading branch information
jsbueno committed Jun 6, 2021
1 parent 5be2153 commit 63d2f6d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion terminedia_paint/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import asyncio
import time
import random
from ast import literal_eval
from math import ceil

Expand Down Expand Up @@ -61,7 +62,8 @@ def __init__(self):

def event_setup(self):
TM.events.Subscription(TM.events.KeyPress, self.key_dispatcher)
TM.events.Subscription(TM.events.MousePress, self.mouse_click)
TM.events.Subscription(TM.events.MouseClick, self.mouse_click)
TM.events.Subscription(TM.events.MouseDoubleClick, self.mouse_double_click)
TM.events.Subscription(TM.events.MouseMove, self.mouse_move)

def tool_setup(self):
Expand Down Expand Up @@ -162,6 +164,10 @@ def mouse_click(self, event):
self.pos = event.pos
self.dirty = True

def mouse_double_click(self, event):
#FIXME - provisional to test double-click event
self.sc.context.char = random.choice("#*!|><")

def mouse_move(self, event):
if event.buttons:
self.active_tool.set_point(event.pos)
Expand Down

0 comments on commit 63d2f6d

Please sign in to comment.