diff --git a/sys.py/UI/.#page.py b/sys.py/UI/.#page.py deleted file mode 120000 index c042f4f..0000000 --- a/sys.py/UI/.#page.py +++ /dev/null @@ -1 +0,0 @@ -guu@guu-desktop.5528:1527716105 \ No newline at end of file diff --git a/sys.py/UI/page.py b/sys.py/UI/page.py index 018a805..c166bd3 100644 --- a/sys.py/UI/page.py +++ b/sys.py/UI/page.py @@ -520,7 +520,7 @@ class Page(object): self._Screen._CurrentPage = child_page elif cur_icon._MyType == ICON_TYPES["FUNC"]: print("IconClick API: %d"%(cur_icon._Index)) - print("%s"% cur_icon._CmdPath) + #print("%s"% cur_icon._CmdPath) api_cb = getattr(cur_icon._CmdPath,"API",None) if api_cb != None: if callable(api_cb): diff --git a/sys.py/run.py b/sys.py/run.py index 00ff168..467cf81 100644 --- a/sys.py/run.py +++ b/sys.py/run.py @@ -135,9 +135,7 @@ def event_process(event,main_screen): global sound_patch global everytime_keydown if event != None: - pygame.event.clear() - if event.type == pygame.ACTIVEEVENT: print(" ACTIVEEVENT !") return @@ -270,7 +268,14 @@ def socket_thread(main_screen): datagram = conn.recv(1024) if datagram: tokens = datagram.strip().split() - + + if tokens[0].lower() == "esc": + escevent = pygame.event.Event(pygame.KEYDOWN,{'scancode':9,'key': 27, 'unicode': u'\x1b', 'mod': 0}) + current_page_key_down_cb = getattr(main_screen._CurrentPage,"KeyDown",None) + if current_page_key_down_cb != None: + if callable( current_page_key_down_cb ): + main_screen._CurrentPage.KeyDown(escevent) + if tokens[0].lower() == "quit": conn.close() on_exit_cb = getattr(main_screen,"OnExitCb",None) @@ -282,6 +287,16 @@ def socket_thread(main_screen): exit() if tokens[0].lower() == "poweroff": + escevent = pygame.event.Event(pygame.KEYDOWN,{'scancode':9,'key': 27, 'unicode': u'\x1b', 'mod': 0}) + for i in range(0,5): + current_page_key_down_cb = getattr(main_screen._CurrentPage,"KeyDown",None) + if current_page_key_down_cb != None: + if callable( current_page_key_down_cb ): + main_screen._CurrentPage.KeyDown(escevent) + + if main_screen._MyPageStack.Length() == 0: ## on Top Level + break + if main_screen._CurrentPage._Name == "GameShell": for i in main_screen._CurrentPage._Icons: if i._MyType == ICON_TYPES["FUNC"]: