MCPcopy Create free account
hub / github.com/codeaashu/claude-code / KeyboardSettings

Function KeyboardSettings

web/components/settings/KeyboardSettings.tsx:118–161  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

116}
117
118export function KeyboardSettings() {
119 const { settings, updateSettings, resetSettings } = useChatStore();
120 const keybindings = settings.keybindings;
121
122 // Find conflicts
123 const bindingValues = Object.values(keybindings);
124 const conflicts = new Set(
125 bindingValues.filter((v, i) => bindingValues.indexOf(v) !== i)
126 );
127
128 function rebind(id: string, combo: string) {
129 updateSettings({ keybindings: { ...keybindings, [id]: combo } });
130 }
131
132 function resetOne(id: string) {
133 updateSettings({
134 keybindings: { ...keybindings, [id]: DEFAULT_SHORTCUTS[id] },
135 });
136 }
137
138 return (
139 <div>
140 <SectionHeader title="Keyboard Shortcuts" onReset={() => resetSettings("keybindings")} />
141
142 <p className="text-xs text-surface-400 mb-4">
143 Click a shortcut to rebind it. Press Escape to cancel.
144 </p>
145
146 <div>
147 {Object.entries(keybindings).map(([id, binding]) => (
148 <ShortcutRow
149 key={id}
150 id={id}
151 binding={binding}
152 isDefault={binding === DEFAULT_SHORTCUTS[id]}
153 isConflict={conflicts.has(binding)}
154 onRebind={(combo) => rebind(id, combo)}
155 onReset={() => resetOne(id)}
156 />
157 ))}
158 </div>
159 </div>
160 );
161}

Callers

nothing calls this directly

Calls 5

rebindFunction · 0.85
resetOneFunction · 0.85
valuesMethod · 0.80
entriesMethod · 0.80
hasMethod · 0.45

Tested by

no test coverage detected