Skip to content

Conversation

@AlexGadd
Copy link
Contributor

@AlexGadd AlexGadd commented Oct 24, 2025

If keys are still held down while it starts typing this can trigger commands or alternative characters to be typed, may need to add a description to warn people if they don't understand how this script works? Not sure if that's standard practice for these commits

Description

Type of change

If keys are still being held down it can cause unexpected outcomes so I added a delay before it starts "typing"

  • New script command
  • Bug fix
  • Improvement of an existing script
  • Documentation update
  • Toolkit change
  • Other (Specify)

Screenshot

Dependencies / Requirements

Checklist

If keys are still held down while it starts typing this can trigger commands or alternative characters to be typed, may need to add a description to warn people if they don't understand how this script works? Not sure if that's standard practice for these commits
@nhojb
Copy link
Contributor

nhojb commented Oct 29, 2025

If keys are still held down while it starts typing this can trigger commands or alternative characters to be typed, may need to add a description to warn people if they don't understand how this script works? Not sure if that's standard practice for these commits

Could you check via applescript if any modifiers keys are active? Then exit the script with an error?

Otherwise just add a comment to the script with the warning about modifiers.

@AlexGadd
Copy link
Contributor Author

Yes, however, part of the issue is that it runs immediately after the key combination is pressed, so you’d have to have inhuman speed to avoid any letters that are typed being effected. I could add a delay plus detecting if keys are down and showing an error window telling them to release the keys. I’ll try add that this week

Returns an alert window to tell the person not to hold modifier keys while the script runs, also added a brief pause before it runs to allow them to release the keys
@AlexGadd
Copy link
Contributor Author

Added the changes to the script

Copy link
Contributor

@nhojb nhojb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

I guess you could use a single javascript script that returns a simple true/false if any of the modifiers are down? But I guess if the overhead of running 5 scripts is not noticeable then it doesn't matter too much.

Happy to merge as-is.

@nhojb nhojb merged commit 89163d6 into raycast:master Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants