Revert "⌨️ feat: Add Shift-Key Shortcuts for Instant Conversation Actions (#10732)"

This reverts commit 41c0a96d39.
This commit is contained in:
Danny Avila 2025-12-15 17:02:16 -05:00
parent dcd9273700
commit 03ced7a894
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
4 changed files with 43 additions and 176 deletions

View file

@ -1,2 +1 @@
export * from './useLazyEffect';
export { default as useShiftKey } from './useShiftKey';

View file

@ -1,40 +0,0 @@
import { useState, useEffect } from 'react';
/**
* Hook to track whether the shift key is currently being held down
* @returns boolean indicating if shift key is pressed
*/
export default function useShiftKey(): boolean {
const [isShiftHeld, setIsShiftHeld] = useState(false);
useEffect(() => {
const handleKeyDown = (e: KeyboardEvent) => {
if (e.key === 'Shift') {
setIsShiftHeld(true);
}
};
const handleKeyUp = (e: KeyboardEvent) => {
if (e.key === 'Shift') {
setIsShiftHeld(false);
}
};
// Reset shift state when window loses focus
const handleBlur = () => {
setIsShiftHeld(false);
};
window.addEventListener('keydown', handleKeyDown);
window.addEventListener('keyup', handleKeyUp);
window.addEventListener('blur', handleBlur);
return () => {
window.removeEventListener('keydown', handleKeyDown);
window.removeEventListener('keyup', handleKeyUp);
window.removeEventListener('blur', handleBlur);
};
}, []);
return isShiftHeld;
}