MCPcopy Create free account
hub / github.com/Bistutu/FluentRead / getConfiguredMouseHotkeyParts

Function getConfiguredMouseHotkeyParts

entrypoints/content.ts:143–170  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

141
142 // 获取当前配置的鼠标悬浮快捷键
143 const getConfiguredMouseHotkeyParts = () => {
144 // 如果选择了自定义快捷键,使用自定义的
145 const hotkeyString = config.hotkey === 'custom'
146 ? config.customHotkey
147 : config.hotkey;
148
149 if (!hotkeyString || hotkeyString === 'none') {
150 return [];
151 }
152
153 // 如果是旧的单个按键格式,直接返回
154 if (!hotkeyString.includes('+')) {
155 const k = hotkeyString.toLowerCase();
156 // 标准化修饰键名称
157 if (k === 'ctrl') return ['control'];
158 if (k === 'option') return ['alt'];
159 return [k];
160 }
161
162 // 组合键格式
163 return hotkeyString.split('+').map(key => {
164 const k = key.toLowerCase();
165 // 标准化修饰键名称
166 if (k === 'ctrl') return 'control';
167 if (k === 'option') return 'alt';
168 return k;
169 });
170 };
171
172 // 检查是否匹配鼠标悬浮快捷键
173 const checkMouseHotkey = () => {

Callers 2

checkMouseHotkeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected