Skip to content

Commit

Permalink
fixed #1044 [tool]
Browse files Browse the repository at this point in the history
enter no longer relaunches the pick tool
  • Loading branch information
eirannejad committed Nov 2, 2020
1 parent bac2592 commit 0101161
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pyrevitlib/pyrevit/forms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,10 @@ def handle_input_key(self, sender, args):
else:
self.Close()
elif args.Key == Input.Key.Enter:
self.process_option(self._get_active_button(), None)
active_button = self._get_active_button()
if active_button:
self.process_option(active_button, None)
args.Handled = True
elif args.Key != Input.Key.Tab \
and args.Key != Input.Key.Space\
and args.Key != Input.Key.LeftShift\
Expand Down Expand Up @@ -1514,8 +1517,10 @@ def handle_kb_key(self, sender, args): #pylint: disable=W0613
self.Close()
# Enter: close, returns matched response automatically
elif args.Key == Input.Key.Enter:
self._setup_response(response=self._search_res)
self.Close()
if self.search_tb.Text != '':
self._setup_response(response=self._search_res)
args.Handled = True
self.Close()
# Shift+Tab, Tab: Cycle through matches
elif args.Key == Input.Key.Tab and shiftdown:
self._result_index -= 1
Expand Down

0 comments on commit 0101161

Please sign in to comment.