Add: Simple Ctrl+Alt+Del button

This commit is contained in:
CaffeeLake
2025-01-26 01:29:36 +09:00
parent 97a9b376c7
commit ae204b418f
21 changed files with 71 additions and 19 deletions

View File

@@ -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',

View File

@@ -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',

View File

@@ -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',

View File

@@ -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',

View File

@@ -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',

View File

@@ -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',

View File

@@ -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',

View File

@@ -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',

View File

@@ -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',

View File

@@ -71,7 +71,8 @@ const ja = {
tips: '標準的なキーボードの文字と記号のみがサポートされています',
placeholder: '入力してください',
submit: '送信',
virtual: 'キーボード'
virtual: 'キーボード',
ctrlaltdel: 'Ctrl+Alt+Del'
},
mouse: {
default: 'デフォルトカーソル',

View File

@@ -70,7 +70,8 @@ const ko = {
tips: '표준 키보드 문자 및 기호만 지원됩니다',
placeholder: '입력하세요',
submit: '제출하다',
virtual: '키보드'
virtual: '키보드',
ctrlaltdel: 'Ctrl+Alt+Del'
},
mouse: {
default: '기본 커서',

View File

@@ -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',

View File

@@ -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',

View File

@@ -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',

View File

@@ -71,7 +71,8 @@ const ru = {
tips: 'Только стандартные буквы и символы клавиатуры поддерживаются',
placeholder: 'Пожалуйста, введите',
submit: 'подтверждать',
virtual: 'Клавиатура'
virtual: 'Клавиатура',
ctrlaltdel: 'Ctrl+Alt+Del'
},
mouse: {
default: 'Курсор по умолчанию',

View File

@@ -71,7 +71,8 @@ const uk = {
tips: 'Підтримуються лише стандартні літери та символи клавіатури',
placeholder: 'Будь ласка, введіть',
submit: 'Надіслати',
virtual: 'Клавіатура'
virtual: 'Клавіатура',
ctrlaltdel: 'Ctrl+Alt+Del'
},
mouse: {
default: 'Курсор за замовчуванням',

View File

@@ -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',

View File

@@ -67,7 +67,8 @@ const zh = {
tips: '仅支持标准键盘的字母和符号',
placeholder: '请输入内容',
submit: '确定',
virtual: '虚拟键盘'
virtual: '虚拟键盘',
ctrlaltdel: 'Ctrl+Alt+Del'
},
mouse: {
default: '默认指针',

View File

@@ -67,7 +67,8 @@ const zh_tw = {
tips: '僅支援標準鍵盤字母和符號',
placeholder: '請輸入內容',
submit: '送出',
virtual: '虛擬鍵盤'
virtual: '虛擬鍵盤',
ctrlaltdel: 'Ctrl+Alt+Del'
},
mouse: {
default: '預設游標',

View 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>
);
}

View File

@@ -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 />
</>
);