[X2Go-Dev] Patch for x2gohtmlclient
Mike Gabriel
mike.gabriel at das-netzwerkteam.de
Wed Aug 21 01:02:34 CEST 2024
Hi Dj ZU,
On Di 20 Aug 2024 18:30:16 CEST, Dj ZU wrote:
> Hi team,
>
> Thank you for the development of X2go, I'm using Kdrive on the Windows
> client on a daily basis and very happy with it!
> I am also using the HTML client but faced limitations with the keyboard
> that I could fix.
> I made the changes directly on the compiled JS but it all happens in
> [x2gohtmlclient.git] / src / x2gokdrivehtmlclient.js
>
> CapsLock and AltGr modifier keys were not effective. Fix:
> @@ -1419,10 +1691,17 @@ X2GoKDriveHTMLClient
> {
> v32[1] |= Mod4Mask;
> }
> + if (e.getModifierState("AltGraph")) {
> + v32[1] |= Mod5Mask;
> + }
> + if (e.getModifierState("CapsLock")) {
> + v32[1] |= LockMask;
> + }
>
> v32[2] = this.web2pc105(e.keyCode);
>
> // console.log(v32[1], v32[2]);
>
> e.preventDefault();
> e.stopPropagation();
>
>
> Minor issue with parsing:
> @@ -1249,7 +1249,7 @@ X2GoKDriveHTMLClient
> case 111 :
> return 106; ///
> case 106 :
> - return 63; //*
> + return 63; // * (putting a space before * here, so that
> nano/gedit do not get confused with syntax highlighting)
> case 109 :
> return 82; //-
>
>
> FYI, since I'm using a French keyboard, I also created a new keymap, but
> this should probably be written differently and add a UI setting in the
> HTML to choose the keyboard mapping.
> - v32[2] = this.web2pc105(e.keyCode);
> + v32[2] = this.web2pc105fr(e.keyCode);
>
> @@ -1312,6 +1312,273 @@ X2GoKDriveHTMLClient
> return nativeCode;
> }
>
> + web2pc105fr(nativeCode)
> + {
> + switch (nativeCode)
> + {
> + //1st row
> + case 222:
> + return 49; // ²
> + case 49:
> + return 10; //1
> + case 50:
> + return 11; //2
> + case 51:
> + return 12; //3
> + case 52:
> + return 13; //4
> + case 53:
> + return 14; //5
> + case 54:
> + return 15; //6
> + case 55:
> + return 16; //7
> + case 56:
> + return 17; //8
> + case 57:
> + return 18; //9
> + case 48:
> + return 19; //0
> + case 169:
> + return 20; //°
> + case 61:
> + return 21; //+
> + case 8:
> + return 22; //BSP
> +
> + //2 row
> + case 9 :
> + return 23; //TAB
> + case 65:
> + return 24; //a
> + case 90:
> + return 25; //z
> + case 69 :
> + return 26; //e
> + case 82 :
> + return 27; //r
> + case 84 :
> + return 28; //t
> + case 89:
> + return 29; //y
> + case 85:
> + return 30; //u
> + case 73:
> + return 31; //i
> + case 79:
> + return 32; //o
> + case 80:
> + return 33; //p
> + case 160:
> + return 34; //[
> + case 164:
> + return 35; //]
> + case 13:
> + return 36; //ENT
> +
> + //3 row
> + case 20 :
> + return 66; //CAPS
> + case 81 :
> + return 38; //q
> + case 83 :
> + return 39; //s
> + case 68 :
> + return 40; //d
> + case 70 :
> + return 41; //f
> + case 71 :
> + return 42; //g
> + case 72 :
> + return 43; //h
> + case 74 :
> + return 44; //j
> + case 75 :
> + return 45; //k
> + case 76 :
> + return 46; //l
> + case 77 :
> + return 47; //m
> + case 165 :
> + return 48; //ù
> + case 170 :
> + return 51; // *
> +
> + //4 row
> + case 16 :
> + return 50; //Shift Left
> + case 60 :
> + return 94; //<
> + case 87 :
> + return 52; //w
> + case 88 :
> + return 53; //x
> + case 67 :
> + return 54; //c
> + case 86 :
> + return 55; //v
> + case 66 :
> + return 56; //b
> + case 78 :
> + return 57; //n
> + case 188 :
> + return 58; //,
> + case 59 :
> + return 59; //;
> + case 58 :
> + return 60; //:
> + case 161 :
> + return 61; //!
> + case 16 :
> + return 62; //Shift Right
> +
> +
> + //5 row
> + case 17 :
> + return 37; //LCTRL
> + case 91 :
> + return 133; //LMETA
> + case 18 :
> + return 64; //LALT
> + case 32 :
> + return 65; //SPACE
> + case 18 :
> + return 108; //RALT
> +// case 92 :
> +// return 134; //RMETA
> +// case 93 :
> +// return 135; //MENU
> + case 17 :
> + return 105; //RCTRL
> +
> +
> + //specials
> + case 27 :
> + return 9; //ESC
> + case 112 :
> + return 67; //F1
> + case 113 :
> + return 68; //F2
> + case 114 :
> + return 69; //F3
> + case 115 :
> + return 70; //F4
> + case 116 :
> + return 71; //F5
> + case 117 :
> + return 72; //F6
> + case 118 :
> + return 73; //F7
> + case 119 :
> + return 74; //F8
> + case 120 :
> + return 75; //F9
> + case 121 :
> + return 76; //F10
> + case 122 :
> + return 95; //F11
> + case 123 :
> + return 96; //F12
> +
> + case 44 :
> + return 107; //print
> +// case 145 :
> +// return 78; //scroll
> +// case 19 :
> +// return 127; //break
> +
> + case 45 :
> + return 118; //ins
> + case 36 :
> + return 110; //home
> + case 33 :
> + return 112; //pgup
> + case 46 :
> + return 119; //del
> + case 35 :
> + return 115; //end
> + case 34 :
> + return 117; //pgdn
> +
> + //arrows
> + case 38 :
> + return 111;
> + case 37 :
> + return 113;
> + case 40 :
> + return 116;
> + case 39 :
> + return 114;
> +
> + //numlock
> + case 144 :
> + return 77; //NLCK
> + case 111 :
> + return 106; ///
> + case 106 :
> + return 63; // *
> + case 109 :
> + return 82; //-
> +
> + case 36 :
> + return 79; //home
> + case 38 :
> + return 80; //up
> + case 33 :
> + return 81; //pgup
> + case 107 :
> + return 86; //+
> +
> + case 37 :
> + return 83; //left
> + case 12 :
> + return 84; //clear
> + case 39 :
> + return 85; //right
> +
> + case 35 :
> + return 87; //end
> + case 40 :
> + return 88; //dwn
> + case 34 :
> + return 89; //pgdn
> + case 13 :
> + return 104; //enter
> +
> + case 45 :
> + return 90; //ins
> + case 46 :
> + return 91; //del
> +
> + case 96 :
> + return 90; //0
> + case 97 :
> + return 87; //1
> + case 98 :
> + return 88; //2
> + case 99 :
> + return 89; //3
> + case 100 :
> + return 83; //4
> + case 101 :
> + return 84; //5
> + case 102 :
> + return 85; //6
> + case 103 :
> + return 79; //7
> + case 104 :
> + return 80; //8
> + case 105 :
> + return 81; //9
> +
> + case 110 :
> + return 91; //.
> +
> +
> + }
> + return nativeCode;
> + }
> +
>
> Cheers!
>
> DjZU
Could you sign up for gitlab.x2go.org and file a merge request there?
https://gitlab.x2go.org/x2go/client/html/x2gohtmlclient
Ideally, one MR per observed issue. Let me know if that works for you...
Mike
--
DAS-NETZWERKTEAM
c\o Technik- und Ökologiezentrum Eckernförde
Mike Gabriel, Marienthaler Str. 17, 24340 Eckernförde
mobile: +49 (1520) 1976 148
landline: +49 (4351) 850 8940
GnuPG Fingerprint: 9BFB AEE8 6C0A A5FF BF22 0782 9AF4 6B30 2577 1B31
mail: mike.gabriel at das-netzwerkteam.de, http://das-netzwerkteam.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 851 bytes
Desc: Digitale PGP-Signatur
URL: <https://lists.x2go.org/pipermail/x2go-dev/attachments/20240820/ddd67817/attachment-0001.sig>
More information about the x2go-dev
mailing list