-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Autofocus on text input area when activating window w/ hotkey #550
Comments
Got this working! By adding to the document.addEventListener('visibilitychange', () =>
document.getElementsByTagName('textarea')[0]?.focus()
) |
Looking into where in the code this file is written, in order to make a PR so others can benefit from this as a new default. Looks like this is where that file's default contents are being written? ChatGPT/src-tauri/src/utils.rs Line 50 in e2969b0
|
Thank you for the suggestion. This file is created during the application initialization and will not take effect for existing users since |
Feature description
It would be a bit smoother and easier if the main ChatGPT text input box was autofocused as soon as the window is opened with the hotkey.
Motivation
Smoother and easier way to invoke chatgpt, more like the default
Cmd+Space
Spotlight search on Mac.Alternatives
Thinking this could be possible with some custom javascript to find the element and focus on it. Something like:
And then calling this function when the Open Window hotkey is pressed.
Or Perhaps another option would be to hook into
document.addEventListener("visibilitychange", focusOnInput)
, if the Page Visibility API works for this sort of application. Unclear if this would work when bringing the window into focus, but if it does, it would work for opening the window with a mouse or using the Application Switcher too (Cmd + Tab).Additional context
No response
The text was updated successfully, but these errors were encountered: