forked from chaosparrot/talon_hud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
event_dispatch.py
28 lines (20 loc) · 1 KB
/
event_dispatch.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from typing import Dict
from talon.scripting import Dispatch
from talon import ui
# Class for general communication between the different layers of the HUD
# NOTE - THIS USES A TALON API THAT IS SUBJECT TO CHANGE AND MIGHT BREAK IN FUTURE VERSIONS
class HeadUpEventDispatch(Dispatch):
def request_persist_preferences(self):
self.dispatch("persist_preferences", True)
def hide_context_menu(self):
self.dispatch("hide_context_menu", True)
def show_context_menu(self, widget_id, position = None, buttons = None):
self.dispatch("show_context_menu", widget_id, position, buttons)
def deactivate_poller(self, poller_name):
self.dispatch("deactivate_poller", poller_name)
def synchronize_widget_poller(self, widget_id):
self.dispatch("synchronize_poller", widget_id)
def focus_path(self, path:str):
self.dispatch("hud_focused", path)
def detect_autofocus(self):
self.dispatch("detect_autofocus")