mirror of https://github.com/jetkvm/kvm.git
Compare commits
1 Commits
b2c1a70b07
...
6d9dc9c1d6
| Author | SHA1 | Date |
|---|---|---|
|
|
6d9dc9c1d6 |
|
|
@ -17,7 +17,6 @@ import { TextAreaWithLabel } from "@components/TextArea";
|
||||||
|
|
||||||
// uint32 max value / 4
|
// uint32 max value / 4
|
||||||
const pasteMaxLength = 1073741824;
|
const pasteMaxLength = 1073741824;
|
||||||
const defaultDelay = 20;
|
|
||||||
|
|
||||||
export default function PasteModal() {
|
export default function PasteModal() {
|
||||||
const TextAreaRef = useRef<HTMLTextAreaElement>(null);
|
const TextAreaRef = useRef<HTMLTextAreaElement>(null);
|
||||||
|
|
@ -28,10 +27,10 @@ export default function PasteModal() {
|
||||||
const { executeMacro, cancelExecuteMacro } = useKeyboard();
|
const { executeMacro, cancelExecuteMacro } = useKeyboard();
|
||||||
|
|
||||||
const [invalidChars, setInvalidChars] = useState<string[]>([]);
|
const [invalidChars, setInvalidChars] = useState<string[]>([]);
|
||||||
const [delayValue, setDelayValue] = useState(defaultDelay);
|
const [delayValue, setDelayValue] = useState(100);
|
||||||
const delay = useMemo(() => {
|
const delay = useMemo(() => {
|
||||||
if (delayValue < 0 || delayValue > 65534) {
|
if (delayValue < 50 || delayValue > 65534) {
|
||||||
return defaultDelay;
|
return 100;
|
||||||
}
|
}
|
||||||
return delayValue;
|
return delayValue;
|
||||||
}, [delayValue]);
|
}, [delayValue]);
|
||||||
|
|
@ -41,7 +40,7 @@ export default function PasteModal() {
|
||||||
const delayClassName = useMemo(() => debugMode ? "" : "hidden", [debugMode]);
|
const delayClassName = useMemo(() => debugMode ? "" : "hidden", [debugMode]);
|
||||||
|
|
||||||
const { setKeyboardLayout } = useSettingsStore();
|
const { setKeyboardLayout } = useSettingsStore();
|
||||||
const { selectedKeyboard } = useKeyboardLayout();
|
const { selectedKeyboard } = useKeyboardLayout();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
send("getKeyboardLayout", {}, (resp: JsonRpcResponse) => {
|
send("getKeyboardLayout", {}, (resp: JsonRpcResponse) => {
|
||||||
|
|
@ -137,8 +136,7 @@ export default function PasteModal() {
|
||||||
<div
|
<div
|
||||||
className="w-full"
|
className="w-full"
|
||||||
onKeyUp={e => e.stopPropagation()}
|
onKeyUp={e => e.stopPropagation()}
|
||||||
onKeyDown={e => e.stopPropagation()}
|
onKeyDown={e => e.stopPropagation()} onKeyDownCapture={e => e.stopPropagation()}
|
||||||
onKeyDownCapture={e => e.stopPropagation()}
|
|
||||||
onKeyUpCapture={e => e.stopPropagation()}
|
onKeyUpCapture={e => e.stopPropagation()}
|
||||||
>
|
>
|
||||||
<TextAreaWithLabel
|
<TextAreaWithLabel
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue