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