feat: add inspector hotkey configuration (inspectHotkey)
#275
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎯 Changes
This PR adds functionality to configure the hotkey that triggers the inspector by introducing
inspectHotkeyinto the devtools config.This was discussed a bit in Discord, so I figured I'd implement this myself as I was growing a little impatient as I frequently use
Cmd+Shift+4on macOS to take screenshots, which conflicts with the default inspector hotkey.Now we've got two subsections within the Keyboard section, as seen in the screenshot below (one to open/close devtools, one to trigger the inspector):
Q: Why is there a modifier called "Ctrl or Meta"?
This is because the hotkey behavior originally operated on logic like
isShiftHeld && (isCtrlHeld || isMetaHeld). This isn't exactly easily representable using a combination of modifiers.One possibility would be to allow for a multiple distinct sets of modifiers to be configured, this way we could have one for
Meta + Shiftand one forCtrl + Shift. However, this would be not only be complex to implement, but it would also require a more complex configuration UI.As such, the "Ctrl or Meta" modifier was used to cater to this.
✅ Checklist
pnpm test:pr.🚀 Release Impact