Don't toLowerCase mouse button sequence steps
This commit is contained in:
@ -28,7 +28,7 @@ export const CommandBar = () => {
|
|||||||
{
|
{
|
||||||
name: 'toggle',
|
name: 'toggle',
|
||||||
title: 'Toggle Command Bar',
|
title: 'Toggle Command Bar',
|
||||||
sequence: 'meta+k',
|
sequence: 'meta+k g RightButton+shift',
|
||||||
action: () => {
|
action: () => {
|
||||||
const type = commandBarState.matches('Closed') ? 'Open' : 'Close'
|
const type = commandBarState.matches('Closed') ? 'Open' : 'Close'
|
||||||
console.log('toggling command bar', type)
|
console.log('toggling command bar', type)
|
||||||
|
|||||||
@ -97,6 +97,8 @@ export function InteractionMapMachineProvider({
|
|||||||
? mapKey(event.data.code)
|
? mapKey(event.data.code)
|
||||||
: mouseButtonToName(event.data.button)
|
: mouseButtonToName(event.data.button)
|
||||||
|
|
||||||
|
console.log('action', action)
|
||||||
|
|
||||||
// if the key is already a modifier key, skip everything else and reject
|
// if the key is already a modifier key, skip everything else and reject
|
||||||
if (isModifierKey(action)) {
|
if (isModifierKey(action)) {
|
||||||
// We return an empty string so that we don't clear the currentSequence
|
// We return an empty string so that we don't clear the currentSequence
|
||||||
@ -121,6 +123,12 @@ export function InteractionMapMachineProvider({
|
|||||||
item.sequence.startsWith(searchString)
|
item.sequence.startsWith(searchString)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
console.log('matches', {
|
||||||
|
matches,
|
||||||
|
interactionMap: context.interactionMap,
|
||||||
|
searchString,
|
||||||
|
})
|
||||||
|
|
||||||
// If we have no matches, reject the promise
|
// If we have no matches, reject the promise
|
||||||
if (matches.length === 0) {
|
if (matches.length === 0) {
|
||||||
return Promise.reject()
|
return Promise.reject()
|
||||||
|
|||||||
@ -28,6 +28,7 @@ const mappedKeys: Record<string, string> = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function mapKey(key: string): string {
|
export function mapKey(key: string): string {
|
||||||
|
if (key.includes('Button')) return key
|
||||||
return (mappedKeys[key] || key)
|
return (mappedKeys[key] || key)
|
||||||
.trim()
|
.trim()
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
|
|||||||
Reference in New Issue
Block a user