MCPcopy Create free account
hub / github.com/apache/cloudstack / sendKeyWithJapaneseKeyboard

Method sendKeyWithJapaneseKeyboard

systemvm/agent/noVNC/core/rfb.js:562–587  ·  view source on GitHub ↗
(keysym, down)

Source from the content-addressed store, hash-verified

560 }
561
562 sendKeyWithJapaneseKeyboard(keysym, down) {
563 let vscancode = this._scancodes[keysym]
564 if (vscancode) {
565 let shifted = vscancode.includes("shift");
566 let vscancode_int = parseInt(vscancode);
567 let isLetter = (keysym >= 65 && keysym <= 90) || (keysym >= 97 && keysym <= 122);
568 if (shifted && !this._shiftPressed && !isLetter) {
569 RFB.messages.keyEvent(this._sock, this._shiftKey, 1);
570 }
571 if (!shifted && this._shiftPressed && !isLetter) {
572 RFB.messages.keyEvent(this._sock, this._shiftKey, 0);
573 }
574 RFB.messages.VMwareExtendedKeyEvent(this._sock, keysym, down, vscancode_int);
575 if (shifted && !this._shiftPressed && !isLetter) {
576 RFB.messages.keyEvent(this._sock, this._shiftKey, 0);
577 }
578 if (!shifted && this._shiftPressed && !isLetter) {
579 RFB.messages.keyEvent(this._sock, this._shiftKey, 1);
580 }
581 } else {
582 if (keysym === 65328) {
583 keysym = 65509; // Caps lock
584 }
585 RFB.messages.keyEvent(this._sock, keysym, down ? 1 : 0);
586 }
587 }
588
589 sendKeyWithSpanishLatamKeyboard(keysym, down) {
590 const VSCODE_ACUTE_LATAM = 26; // The ASCII code of acute is 180

Callers 1

sendKeyMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected