ahkohd / tauri-macos-spotlight-example

An example macOS Spotlight app built with Tauri
MIT License
148 stars 9 forks source link

Close the application on `escape` key press #5

Closed elanzini closed 1 year ago

elanzini commented 1 year ago

It would be cool to emulate the spotlight functionality where the application is closed when escape key is pressed. Thanks again for putting this example together!

ahkohd commented 1 year ago

Implemented; see commit 660f714.

elanzini commented 1 year ago

Here is what I mean about the focus not working in #4. At the start the focus is on the text box, then I open the app (Command + K) and the focus is on the app. I press escape, the app is closed but the focus is not back on the text box.

https://user-images.githubusercontent.com/37532050/218580307-852038d3-9061-499c-8d38-e919032bb4c3.mov

ahkohd commented 1 year ago

I'll close this issue since the <Esc> to close window feature has been implemented.

ahkohd commented 1 year ago

@elanzini your issue has been fixed in this commit dde828c. Let's move the refocus window discussion to #4.

ahkohd commented 1 year ago

I have updated the implementation of the press <Esc> to hide the spotlight window. See commit https://github.com/ahkohd/tauri-macos-spotlight-example/commit/5be85f387a3d001dadd31906c3359541bfeff7a2.