@lobehub/chat
Version:
Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.
14 lines (10 loc) • 322 B
text/typescript
import { KeyboardEvent } from 'react';
import { isMacOS } from './platform';
export const isCommandPressed = (event: KeyboardEvent) => {
const isMac = isMacOS();
if (isMac) {
return event.metaKey; // Use metaKey (Command key) on macOS
} else {
return event.ctrlKey; // Use ctrlKey on Windows/Linux
}
};