mirror of
https://github.com/sipeed/NanoKVM.git
synced 2026-09-11 00:22:56 -05:00
Add: Simple Ctrl+Alt+Del button
This commit is contained in:
@@ -71,7 +71,8 @@ const cz = {
|
||||
tips: 'Podporovány jsou pouze standardní písmena a symboly klávesnice',
|
||||
placeholder: 'Zadejte text',
|
||||
submit: 'Odeslat',
|
||||
virtual: 'Klávesnice'
|
||||
virtual: 'Klávesnice',
|
||||
ctrlaltdel: 'Ctrl+Alt+Del'
|
||||
},
|
||||
mouse: {
|
||||
default: 'Výchozí kurzor',
|
||||
|
||||
@@ -70,7 +70,8 @@ const da = {
|
||||
tips: 'Kun standard bogstaver og symboler er understøttet',
|
||||
placeholder: 'Indtast tekst',
|
||||
submit: 'Send',
|
||||
virtual: 'Tastatur'
|
||||
virtual: 'Tastatur',
|
||||
ctrlaltdel: 'Ctrl+Alt+Del'
|
||||
},
|
||||
mouse: {
|
||||
default: 'Standard-markør',
|
||||
|
||||
@@ -71,7 +71,8 @@ const de = {
|
||||
tips: 'Nur Standard-Tastaturbuchstaben und Symbole werden unterstützt.',
|
||||
placeholder: 'Bitte eingeben',
|
||||
submit: 'Senden',
|
||||
virtual: 'Virtuelle Tastatur'
|
||||
virtual: 'Virtuelle Tastatur',
|
||||
ctrlaltdel: 'Ctrl+Alt+Del'
|
||||
},
|
||||
mouse: {
|
||||
default: 'Standard Cursor',
|
||||
|
||||
@@ -69,7 +69,8 @@ const en = {
|
||||
tips: 'Only standard keyboard letters and symbols are supported',
|
||||
placeholder: 'Please input',
|
||||
submit: 'Submit',
|
||||
virtual: 'Keyboard'
|
||||
virtual: 'Keyboard',
|
||||
ctrlaltdel: 'Ctrl+Alt+Del'
|
||||
},
|
||||
mouse: {
|
||||
default: 'Default cursor',
|
||||
|
||||
@@ -71,7 +71,8 @@ const en = {
|
||||
tips: 'Solo están soportadas las letras y símbolos estándar del teclado',
|
||||
placeholder: 'Por favor, introduce el texto',
|
||||
submit: 'Enviar',
|
||||
virtual: 'Teclado virtual'
|
||||
virtual: 'Teclado virtual',
|
||||
ctrlaltdel: 'Ctrl+Alt+Del'
|
||||
},
|
||||
mouse: {
|
||||
default: 'Cursor por defecto',
|
||||
|
||||
@@ -71,7 +71,8 @@ const fr = {
|
||||
tips: 'Seuls les caractères et symboles standard du clavier sont pris en charge',
|
||||
placeholder: 'Veuillez saisir',
|
||||
submit: 'Soumettre',
|
||||
virtual: 'Clavier'
|
||||
virtual: 'Clavier',
|
||||
ctrlaltdel: 'Ctrl+Alt+Del'
|
||||
},
|
||||
mouse: {
|
||||
default: 'Curseur par défaut',
|
||||
|
||||
@@ -71,7 +71,8 @@ const hu = {
|
||||
tips: 'Csak a szabványos billentyűzet betűi és szimbólumai támogatottak',
|
||||
placeholder: 'Írja be',
|
||||
submit: 'Elküldés',
|
||||
virtual: 'Billentyűzet'
|
||||
virtual: 'Billentyűzet',
|
||||
ctrlaltdel: 'Ctrl+Alt+Del'
|
||||
},
|
||||
mouse: {
|
||||
default: 'Alapértelmezett kurzor',
|
||||
|
||||
@@ -70,7 +70,8 @@ const id = {
|
||||
tips: 'Hanya huruf dan simbol keyboard standar yang didukung',
|
||||
placeholder: 'Silahkan isi',
|
||||
submit: 'Kirimkan',
|
||||
virtual: 'Keyboard'
|
||||
virtual: 'Keyboard',
|
||||
ctrlaltdel: 'Ctrl+Alt+Del'
|
||||
},
|
||||
mouse: {
|
||||
default: 'Kursor bawaan',
|
||||
|
||||
@@ -71,7 +71,8 @@ const it = {
|
||||
tips: 'Sono supportati solo lettere e simboli standard della tastiera',
|
||||
placeholder: 'Inserisci testo',
|
||||
submit: 'Invia',
|
||||
virtual: 'Tastiera'
|
||||
virtual: 'Tastiera',
|
||||
ctrlaltdel: 'Ctrl+Alt+Del'
|
||||
},
|
||||
mouse: {
|
||||
default: 'Cursore predefinito',
|
||||
|
||||
@@ -71,7 +71,8 @@ const ja = {
|
||||
tips: '標準的なキーボードの文字と記号のみがサポートされています',
|
||||
placeholder: '入力してください',
|
||||
submit: '送信',
|
||||
virtual: 'キーボード'
|
||||
virtual: 'キーボード',
|
||||
ctrlaltdel: 'Ctrl+Alt+Del'
|
||||
},
|
||||
mouse: {
|
||||
default: 'デフォルトカーソル',
|
||||
|
||||
@@ -70,7 +70,8 @@ const ko = {
|
||||
tips: '표준 키보드 문자 및 기호만 지원됩니다',
|
||||
placeholder: '입력하세요',
|
||||
submit: '제출하다',
|
||||
virtual: '키보드'
|
||||
virtual: '키보드',
|
||||
ctrlaltdel: 'Ctrl+Alt+Del'
|
||||
},
|
||||
mouse: {
|
||||
default: '기본 커서',
|
||||
|
||||
@@ -71,7 +71,8 @@ const nb = {
|
||||
tips: 'Kun vanlige tegn på tastatur er støttet',
|
||||
placeholder: 'Vennligst angi teksten du vil lime inn',
|
||||
submit: 'Lim inn',
|
||||
virtual: 'Åpne tastatur'
|
||||
virtual: 'Åpne tastatur',
|
||||
ctrlaltdel: 'Ctrl+Alt+Del'
|
||||
},
|
||||
mouse: {
|
||||
default: 'Vanlig',
|
||||
|
||||
@@ -71,7 +71,8 @@ const nl = {
|
||||
tips: 'Alleen standaard toetsenbordletters en symbolen worden ondersteund',
|
||||
placeholder: 'Voer tekst in',
|
||||
submit: 'Verzenden',
|
||||
virtual: 'Toetsenbord'
|
||||
virtual: 'Toetsenbord',
|
||||
ctrlaltdel: 'Ctrl+Alt+Del'
|
||||
},
|
||||
mouse: {
|
||||
default: 'Standaard cursor',
|
||||
|
||||
@@ -63,7 +63,8 @@ const pl = {
|
||||
tips: 'Tylko standardowe klawiaturowe znaki i symbole są obsługiwane.',
|
||||
placeholder: 'Proszę wprowadzić coś',
|
||||
submit: 'Prześlij',
|
||||
virtual: 'Klawiatura'
|
||||
virtual: 'Klawiatura',
|
||||
ctrlaltdel: 'Ctrl+Alt+Del'
|
||||
},
|
||||
mouse: {
|
||||
default: 'Domyślny kursor',
|
||||
|
||||
@@ -71,7 +71,8 @@ const ru = {
|
||||
tips: 'Только стандартные буквы и символы клавиатуры поддерживаются',
|
||||
placeholder: 'Пожалуйста, введите',
|
||||
submit: 'подтверждать',
|
||||
virtual: 'Клавиатура'
|
||||
virtual: 'Клавиатура',
|
||||
ctrlaltdel: 'Ctrl+Alt+Del'
|
||||
},
|
||||
mouse: {
|
||||
default: 'Курсор по умолчанию',
|
||||
|
||||
@@ -71,7 +71,8 @@ const uk = {
|
||||
tips: 'Підтримуються лише стандартні літери та символи клавіатури',
|
||||
placeholder: 'Будь ласка, введіть',
|
||||
submit: 'Надіслати',
|
||||
virtual: 'Клавіатура'
|
||||
virtual: 'Клавіатура',
|
||||
ctrlaltdel: 'Ctrl+Alt+Del'
|
||||
},
|
||||
mouse: {
|
||||
default: 'Курсор за замовчуванням',
|
||||
|
||||
@@ -70,7 +70,8 @@ const vi = {
|
||||
tips: 'Chỉ hỗ trợ các chữ cái và ký hiệu bàn phím tiêu chuẩn',
|
||||
placeholder: 'Vui lòng nhập',
|
||||
submit: 'Gửi',
|
||||
virtual: 'Bàn phím'
|
||||
virtual: 'Bàn phím',
|
||||
ctrlaltdel: 'Ctrl+Alt+Del'
|
||||
},
|
||||
mouse: {
|
||||
default: 'Con trỏ mặc định',
|
||||
|
||||
@@ -67,7 +67,8 @@ const zh = {
|
||||
tips: '仅支持标准键盘的字母和符号',
|
||||
placeholder: '请输入内容',
|
||||
submit: '确定',
|
||||
virtual: '虚拟键盘'
|
||||
virtual: '虚拟键盘',
|
||||
ctrlaltdel: 'Ctrl+Alt+Del'
|
||||
},
|
||||
mouse: {
|
||||
default: '默认指针',
|
||||
|
||||
@@ -67,7 +67,8 @@ const zh_tw = {
|
||||
tips: '僅支援標準鍵盤字母和符號',
|
||||
placeholder: '請輸入內容',
|
||||
submit: '送出',
|
||||
virtual: '虛擬鍵盤'
|
||||
virtual: '虛擬鍵盤',
|
||||
ctrlaltdel: 'Ctrl+Alt+Del'
|
||||
},
|
||||
mouse: {
|
||||
default: '預設游標',
|
||||
|
||||
31
web/src/pages/desktop/menu/keyboard/ctrl-alt-del.tsx
Normal file
31
web/src/pages/desktop/menu/keyboard/ctrl-alt-del.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
import clsx from 'clsx';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { OctagonMinus } from 'lucide-react';
|
||||
|
||||
import { KeyboardCodes, ModifierCodes } from '@/pages/desktop/keyboard/mappings.ts';
|
||||
import { client } from '@/lib/websocket.ts';
|
||||
|
||||
export const CtrlAltDel = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
function sendCtrlAltDel() {
|
||||
const ctrl = ModifierCodes.get('ControlLeft')!;
|
||||
const alt = ModifierCodes.get('AltLeft')!;
|
||||
const del = KeyboardCodes.get('Delete')!;
|
||||
|
||||
client.send([1, del, ctrl, 0, alt, 0]);
|
||||
client.send([1, 0, 0, 0, 0, 0]);
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
className={clsx(
|
||||
"flex cursor-pointer select-none items-center space-x-2 rounded py-1 pl-2 pr-5 hover:bg-neutral-700/70"
|
||||
)}
|
||||
onClick={sendCtrlAltDel}
|
||||
>
|
||||
<OctagonMinus size={18} />
|
||||
<span>{t('keyboard.ctrlaltdel')}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import { KeyboardIcon } from 'lucide-react';
|
||||
|
||||
import { Paste } from './paste.tsx';
|
||||
import { VirtualKeyboard } from './virtual-keyboard.tsx';
|
||||
import { CtrlAltDel } from './ctrl-alt-del.tsx';
|
||||
|
||||
export const Keyboard = () => {
|
||||
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
|
||||
@@ -12,6 +13,7 @@ export const Keyboard = () => {
|
||||
<>
|
||||
<Paste setIsPopoverOpen={setIsPopoverOpen} />
|
||||
<VirtualKeyboard />
|
||||
<CtrlAltDel />
|
||||
</>
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user