i-am-shodan/ReTerm

Unable to type "@"

Closed this issue · 21 comments

Hi,

I just installed the latest release on a remarkable 2 with the USA/American type folio variant. I am running version 3.2.3.1595 and my issue is that basically if I press "Shift+2" the character that appears is a '"' instead of the "@" like in xochitl (It's the same with the right shift and the left shift keys).

Also I am wondering, How can we get symbols like '|' in the terminal?.

Let me know if I can provide more information somehow, and thanks for this software, I am really looking forward to a future stable version.

If you are using the version I pushed a few hours ago then you are in luck. Keyboard layout is now completely customisable. I've already added hot keys for pipe.

Check out ~/.ReTerm/settings.json and see what you think.

Ah I was about to report that Shift + 3 also behaves a little bit weird, it inserts the "#" character but after it, it seems like it's doing a '\n' keypress.

I will have a look at the settings, thanks!

If you can post a config that works for your keyboard layout I'll see what I can do to auto detect it

I am probably blind but I cannot find a setting for the "~" key (it doesn't seem to work at all, as in it doesn't have any effect on reTerm).

screenshot1

Here is my config so far (still missing the ~):

{
  "KeyboardKeyLookup": {
    "Enter": {
      "None": [
        "\n"
      ]
    },
    "Backspace": {
      "None": [
        "\b"
      ]
    },
    "Space": {
      "None": [
        " "
      ]
    },
    "Tab": {
      "None": [
        "\t"
      ],
      "Shift": [
        "\u001b"
      ]
    },
    "CapsLock": {
      "None": [
        "|"
      ],
      "Shift": [
        "\u001b"
      ]
    },
    "Grave": {
      "None": [
        "`"
      ],
      "Shift": [
        "\u005c"
      ]
    },
    "Semicolon": {
      "None": [
        ";"
      ],
      "Shift": [
        ":"
      ]
    },
    "Apostrophe": {
      "None": [
        "'"
      ],
      "Shift": [
        "\""
      ]
    },
    "Comma": {
      "None": [
        ","
      ],
      "Shift": [
        "<"
      ]
    },
    "Period": {
      "None": [
        "."
      ],
      "Shift": [
        ">"
      ]
    },
    "Slash": {
      "None": [
        "/"
      ],
      "Shift": [
        "?"
      ],
      "Opt": [
        "\\"
      ],
      "Ctrl": [
        "\u001c"
      ]
    },
    "Equal": {
      "None": [
        "-"
      ],
      "Shift": [
        "_"
      ],
      "Opt": [
        "="
      ]
    },
    "Down": {
      "None": [
        "\u001b",
        "[",
        "B"
      ]
    },
    "Up": {
      "None": [
        "\u001b",
        "[",
        "A"
      ]
    },
    "Left": {
      "None": [
        "\u001b",
        "[",
        "D"
      ]
    },
    "Right": {
      "None": [
        "\u001b",
        "[",
        "C"
      ]
    },
    "NumberRow1": {
      "None": [
        "1"
      ],
      "Shift": [
        "!"
      ],
      "Opt": [
        "\u001b"
      ]
    },
    "NumberRow2": {
      "None": [
        "2"
      ],
      "Shift": [
        "@"
      ]
    },
    "NumberRow3": {
      "None": [
        "3"
      ],
      "Shift": [
        "#"
      ]
    },
    "NumberRow4": {
      "None": [
        "4"
      ],
      "Shift": [
        "$"
      ]
    },
    "NumberRow5": {
      "None": [
        "5"
      ],
      "Shift": [
        "%"
      ]
    },
    "NumberRow6": {
      "None": [
        "6"
      ],
      "Shift": [
        "^"
      ]
    },
    "NumberRow7": {
      "None": [
        "7"
      ],
      "Shift": [
        "&"
      ]
    },
    "NumberRow8": {
      "None": [
        "8"
      ],
      "Shift": [
        "*"
      ]
    },
    "NumberRow9": {
      "None": [
        "9"
      ],
      "Shift": [
        "("
      ],
      "Opt": [
        "\""
      ]
    },
    "NumberRow0": {
      "None": [
        "0"
      ],
      "Shift": [
        ")"
      ],
      "Opt": [
        "+"
      ]
    },
    "A": {
      "None": [
        "a"
      ],
      "Shift": [
        "A"
      ],
      "Ctrl": [
        "\u0001"
      ]
    },
    "B": {
      "None": [
        "b"
      ],
      "Shift": [
        "B"
      ],
      "Ctrl" : [
        "\u0002"
      ]
    },
    "C": {
      "None": [
        "c"
      ],
      "Shift": [
        "C"
      ],
      "Ctrl": [
        "\u0003"
      ]
    },
    "D": {
      "None": [
        "d"
      ],
      "Shift": [
        "D"
      ],
      "Ctrl": [
        "\u0004"
      ]
    },
    "E": {
      "None": [
        "e"
      ],
      "Shift": [
        "E"
      ]
    },
    "F": {
      "None": [
        "f"
      ],
      "Shift": [
        "F"
      ]
    },
    "G": {
      "None": [
        "g"
      ],
      "Shift": [
        "G"
      ],
      "Ctrl": [
        "\u0007"
      ]
    },
    "H": {
      "None": [
        "h"
      ],
      "Shift": [
        "H"
      ]
    },
    "I": {
      "None": [
        "i"
      ],
      "Shift": [
        "I"
      ]
    },
    "J": {
      "None": [
        "j"
      ],
      "Shift": [
        "J"
      ],
      "Ctrl": [
        "\n"
      ]
    },
    "K": {
      "None": [
        "k"
      ],
      "Shift": [
        "K"
      ],
      "Ctrl": [
        "\u000b"
      ]
    },
    "L": {
      "None": [
        "l"
      ],
      "Shift": [
        "L"
      ],
      "Ctrl": [
        "\u000c"
      ]
    },
    "M": {
      "None": [
        "m"
      ],
      "Shift": [
        "M"
      ]
    },
    "N": {
      "None": [
        "n"
      ],
      "Shift": [
        "N"
      ]
    },
    "O": {
      "None": [
        "o"
      ],
      "Shift": [
        "O"
      ],
      "Ctrl": [
        "\u000f"
      ]
    },
    "P": {
      "None": [
        "p"
      ],
      "Shift": [
        "P"
      ]
    },
    "Q": {
      "None": [
        "q"
      ],
      "Shift": [
        "Q"
      ],
      "Ctrl": [
        "\u0011"
      ]
    },
    "R": {
      "None": [
        "r"
      ],
      "Shift": [
        "R"
      ],
      "Ctrl": [
        "\u0012"
      ]
    },
    "S": {
      "None": [
        "s"
      ],
      "Shift": [
        "S"
      ],
      "Ctrl": [
        "\u0013"
      ]
    },
    "T": {
      "None": [
        "t"
      ],
      "Shift": [
        "T"
      ],
      "Ctrl": [
        "\u0014"
      ]
    },
    "U": {
      "None": [
        "u"
      ],
      "Shift": [
        "U"
      ],
      "Ctrl": [
        "\u0015"
      ]
    },
    "V": {
      "None": [
        "v"
      ],
      "Shift": [
        "V"
      ],
      "Ctrl": [
        "\u0016"
      ]
    },
    "W": {
      "None": [
        "w"
      ],
      "Shift": [
        "W"
      ],
      "Ctrl": [
        "\u0017"
      ]
    },
    "X": {
      "None": [
        "x"
      ],
      "Shift": [
        "X"
      ],
      "Ctrl": [
        "\u0018"
      ]
    },
    "Y": {
      "None": [
        "y"
      ],
      "Shift": [
        "Y"
      ]
    },
    "Z": {
      "None": [
        "z"
      ],
      "Shift": [
        "Z"
      ],
      "Ctrl": [
        "\u001a"
      ]
    }
  },
  "DontBlinkCursor": false,
  "DisableMouseAndTouch": false,
  "TouchMarksClearTime": "00:00:10",
  "CursorBlinkInterval": "00:00:00.5000000",
  "ForceBackgroundHexColor": "#FFFFFF",
  "ForceForegroundHexColor": "#000000",
  "FontPath": "",
  "FontName": "",
  "FontSize": 48
}

I suspect that the folio generates an incorrect key mapping for that key. On my folio Home/End are mapped to opt I think.

The easiest thing to do is build ReTerm from source, add some debugging to the keyboard handling code and find exactly what ReTerm thinks is being pressed when you hit that key.

Pressing Ctrl + L with that config, resets the cursor back to the beginning, but it doesn't clear the screen like I would expect in my Linux terminal.

There are also some issues with GNU Screen it seems, after adding Ctrl + a, I can move between the "windows" but the whole terminal ends up being messed up (Not sure if those are separate issues if so let me know I can open them).

Console.WriteLine(e.Key.ToString());

on line 310 on Program.cs in the Keyboard_Released function is what you'd need to do.

You should SSH into another machine and run screen there. Then if you still get issues you can rule out all everything apart from ReTerm.

You should SSH into another machine and run screen there. Then if you still get issues you can rule out all everything apart from ReTerm.

This is connecting to another (Ubuntu 22.04) server, I mean screen is running on the server, and of course it works fine if I connect from my computer.

Console.WriteLine(e.Key.ToString());

on line 310 on Program.cs in the Keyboard_Released function is what you'd need to do.

I am going to need a little bit more of guidance with setting up dotnet etc... keep in mind that my laptop is running Linux, and I have 0 idea of C#, is there a docker container or something with the environment to get it built?.

Apparently there is showkey available on the reMarkable 2 so perhaps there is no need for me to recompile it:

reMarkable: ~/ showkey
kb mode was UNICODE
[ if you are trying this under X, it might not work
since the X server is also reading /dev/console ]

press any key (program terminates 10s after last keypress)...
keycode  43 press
keycode  43 release

That's the keycode I get when I press the key, and below you can find the scancode (I pressed it twice):

reMarkable: ~/ showkey -s      
kb mode was UNICODE
[ if you are trying this under X, it might not work
since the X server is also reading /dev/console ]

press any key (program terminates 10s after last keypress)...
0x2b 
0xab 
0x2b 
0xab

Nevermind I managed to compile it, what I see on the journalctl output is:

Jul 15 14:39:42 reMarkable tarnish[1876]: rm.epaperkeyboardhandler.map: Processing key event: keycode= 43, modifiers=00 pressed=1, autorepeat=0
Jul 15 14:39:42 reMarkable tarnish[1876]: rm.epaperkeyboardhandler.map: Processing: uni=0303, qt=01001253, qtmod=00000000
Jul 15 14:39:42 reMarkable ReTerm[1876]: Backslash
Jul 15 14:39:42 reMarkable tarnish[1876]: rm.epaperkeyboardhandler.map: Processing key event: keycode= 43, modifiers=00 pressed=0, autorepeat=0
Jul 15 14:39:42 reMarkable tarnish[1876]: rm.epaperkeyboardhandler.map: Processing: uni=0303, qt=01001253, qtmod=00000000

Backslash?

Kinda makes sense as that's where the backslash key would be on an iso keyboard layout

By the way (And this is kind of a note for me hehe), and just for the record I compiled it using docker as:

$ cd /tmp
$ git clone https://github.com/i-am-shodan/ReTerm.git
$ docker pull mcr.microsoft.com/dotnet/sdk:6.0
$ docker run --rm -it \
        -v /tmp/ReTerm:/app \
        -w /app --entrypoint /bin/bash \
        mcr.microsoft.com/dotnet/sdk:6.0
# Inside the container run:
$ cd /app
$ dotnet publish --self-contained true -r linux-arm -p:PublishSingleFile=true -p:PublishedTrimmed=true -p:PublishReadyToRun=true -p:Configuration=Release -p:PublishReadyToRunShowWarnings=true -c Release src/ReTerm/ReTerm.csproj

Backslash?

Kinda makes sense as that's where the backslash key would be on an iso keyboard layout

Yes this variant also seems to have a shorter return key that the others (DE/ES/UK etc...), so this key is not existent in the other variants I guess, at least not in the same place.

By the way (And this is kind of a note for me hehe), and just for the record I compiled it using docker as:


$ cd /tmp

$ git clone https://github.com/i-am-shodan/ReTerm.git

$ docker pull mcr.microsoft.com/dotnet/sdk:6.0

$ docker run --rm -it \

        -v /tmp/ReTerm:/app \

        -w /app --entrypoint /bin/bash \

        mcr.microsoft.com/dotnet/sdk:6.0

# Inside the container run:

$ cd /app

$ dotnet publish --self-contained true -r linux-arm -p:PublishSingleFile=true -p:PublishedTrimmed=true -p:PublishReadyToRun=true -p:Configuration=Release -p:PublishReadyToRunShowWarnings=true -c Release src/ReTerm/ReTerm.csproj

I suppose you could also fork the repo, open in code spaces then commit the change. An updated package should be compiled and come out as an new dated release.

Could all be done in the browser

I am not even sure of what the other symbol in the key is other than the tilde symbol, I believe it is an umlaut, if I am not mistaken what's missing in the settings.json then is:

"Backslash": {
         "None": [
           "~"
        ],
        "Shift": [
           "¨"
        ]
      }

Well I am not sure about the umlaut, I am not sure if ReTerm handles that kind of character (like in naïve I guess), but at least the ~ works now.

This is how the settings.json would look like in the end for me, I also added Ctrl + e (To move at the end of the command when you are typing on the terminal a long line), hopefully it is useful:

{
  "KeyboardKeyLookup": {
    "Enter": {
      "None": [
        "\n"
      ]
    },
    "Backslash": {
      "None": [
         "~"
      ],
      "Shift": [
         "¨"
      ]
    },
    "Backspace": {
      "None": [
        "\b"
      ]
    },
    "Space": {
      "None": [
        " "
      ]
    },
    "Tab": {
      "None": [
        "\t"
      ],
      "Shift": [
        "\u001b"
      ]
    },
    "CapsLock": {
      "None": [
        "|"
      ],
      "Shift": [
        "\u001b"
      ]
    },
    "Grave": {
      "None": [
        "`"
      ],
      "Shift": [
        "\u005c"
      ]
    },
    "Semicolon": {
      "None": [
        ";"
      ],
      "Shift": [
        ":"
      ]
    },
    "Apostrophe": {
      "None": [
        "'"
      ],
      "Shift": [
        "\""
      ]
    },
    "Comma": {
      "None": [
        ","
      ],
      "Shift": [
        "<"
      ]
    },
    "Period": {
      "None": [
        "."
      ],
      "Shift": [
        ">"
      ]
    },
    "Slash": {
      "None": [
        "/"
      ],
      "Shift": [
        "?"
      ],
      "Opt": [
        "\\"
      ],
      "Ctrl": [
        "\u001c"
      ]
    },
    "Equal": {
      "None": [
        "-"
      ],
      "Shift": [
        "_"
      ],
      "Opt": [
        "="
      ]
    },
    "Down": {
      "None": [
        "\u001b",
        "[",
        "B"
      ]
    },
    "Up": {
      "None": [
        "\u001b",
        "[",
        "A"
      ]
    },
    "Left": {
      "None": [
        "\u001b",
        "[",
        "D"
      ]
    },
    "Right": {
      "None": [
        "\u001b",
        "[",
        "C"
      ]
    },
    "NumberRow1": {
      "None": [
        "1"
      ],
      "Shift": [
        "!"
      ],
      "Opt": [
        "\u001b"
      ]
    },
    "NumberRow2": {
      "None": [
        "2"
      ],
      "Shift": [
        "@"
      ]
    },
    "NumberRow3": {
      "None": [
        "3"
      ],
      "Shift": [
        "#"
      ]
    },
    "NumberRow4": {
      "None": [
        "4"
      ],
      "Shift": [
        "$"
      ]
    },
    "NumberRow5": {
      "None": [
        "5"
      ],
      "Shift": [
        "%"
      ]
    },
    "NumberRow6": {
      "None": [
        "6"
      ],
      "Shift": [
        "^"
      ]
    },
    "NumberRow7": {
      "None": [
        "7"
      ],
      "Shift": [
        "&"
      ]
    },
    "NumberRow8": {
      "None": [
        "8"
      ],
      "Shift": [
        "*"
      ]
    },
    "NumberRow9": {
      "None": [
        "9"
      ],
      "Shift": [
        "("
      ],
      "Opt": [
        "\""
      ]
    },
    "NumberRow0": {
      "None": [
        "0"
      ],
      "Shift": [
        ")"
      ],
      "Opt": [
        "+"
      ]
    },
    "A": {
      "None": [
        "a"
      ],
      "Shift": [
        "A"
      ],
      "Ctrl": [
        "\u0001"
      ]
    },
    "B": {
      "None": [
        "b"
      ],
      "Shift": [
        "B"
      ],
      "Ctrl" : [
        "\u0002"
      ]
    },
    "C": {
      "None": [
        "c"
      ],
      "Shift": [
        "C"
      ],
      "Ctrl": [
        "\u0003"
      ]
    },
    "D": {
      "None": [
        "d"
      ],
      "Shift": [
        "D"
      ],
      "Ctrl": [
        "\u0004"
      ]
    },
    "E": {
      "None": [
        "e"
      ],
      "Shift": [
        "E"
      ],
      "Ctrl": [
        "\u0005"
      ]
    },
    "F": {
      "None": [
        "f"
      ],
      "Shift": [
        "F"
      ]
    },
    "G": {
      "None": [
        "g"
      ],
      "Shift": [
        "G"
      ],
      "Ctrl": [
        "\u0007"
      ]
    },
    "H": {
      "None": [
        "h"
      ],
      "Shift": [
        "H"
      ]
    },
    "I": {
      "None": [
        "i"
      ],
      "Shift": [
        "I"
      ]
    },
    "J": {
      "None": [
        "j"
      ],
      "Shift": [
        "J"
      ],
      "Ctrl": [
        "\n"
      ]
    },
    "K": {
      "None": [
        "k"
      ],
      "Shift": [
        "K"
      ],
      "Ctrl": [
        "\u000b"
      ]
    },
    "L": {
      "None": [
        "l"
      ],
      "Shift": [
        "L"
      ],
      "Ctrl": [
        "\u000c"
      ]
    },
    "M": {
      "None": [
        "m"
      ],
      "Shift": [
        "M"
      ]
    },
    "N": {
      "None": [
        "n"
      ],
      "Shift": [
        "N"
      ]
    },
    "O": {
      "None": [
        "o"
      ],
      "Shift": [
        "O"
      ],
      "Ctrl": [
        "\u000f"
      ]
    },
    "P": {
      "None": [
        "p"
      ],
      "Shift": [
        "P"
      ]
    },
    "Q": {
      "None": [
        "q"
      ],
      "Shift": [
        "Q"
      ],
      "Ctrl": [
        "\u0011"
      ]
    },
    "R": {
      "None": [
        "r"
      ],
      "Shift": [
        "R"
      ],
      "Ctrl": [
        "\u0012"
      ]
    },
    "S": {
      "None": [
        "s"
      ],
      "Shift": [
        "S"
      ],
      "Ctrl": [
        "\u0013"
      ]
    },
    "T": {
      "None": [
        "t"
      ],
      "Shift": [
        "T"
      ],
      "Ctrl": [
        "\u0014"
      ]
    },
    "U": {
      "None": [
        "u"
      ],
      "Shift": [
        "U"
      ],
      "Ctrl": [
        "\u0015"
      ]
    },
    "V": {
      "None": [
        "v"
      ],
      "Shift": [
        "V"
      ],
      "Ctrl": [
        "\u0016"
      ]
    },
    "W": {
      "None": [
        "w"
      ],
      "Shift": [
        "W"
      ],
      "Ctrl": [
        "\u0017"
      ]
    },
    "X": {
      "None": [
        "x"
      ],
      "Shift": [
        "X"
      ],
      "Ctrl": [
        "\u0018"
      ]
    },
    "Y": {
      "None": [
        "y"
      ],
      "Shift": [
        "Y"
      ]
    },
    "Z": {
      "None": [
        "z"
      ],
      "Shift": [
        "Z"
      ],
      "Ctrl": [
        "\u001a"
      ]
    }
  },
  "DontBlinkCursor": false,
  "DisableMouseAndTouch": false,
  "TouchMarksClearTime": "00:00:10",
  "CursorBlinkInterval": "00:00:00.5000000",
  "ForceBackgroundHexColor": "#FFFFFF",
  "ForceForegroundHexColor": "#000000",
  "FontPath": "",
  "FontName": "",
  "FontSize": 48
}

I've incorporated this into the latest version. Please delete your settings file and it should autodetect your kbd layout