2

I see that Linux has a more user-friendly version of the ALT codes used to type in special symbols. I need to be able to find an application that will accept and correctly interpret those alt codes, typical on Windows machines.

I have a portable word processor, an AlphaSmart. It holds some files in memory, but I often need to transfer these to my computer after writing them. When attached to a computer, it pretends it is an actual keyboard, and sends the text as if someone is typing. It just types really fast. So I just open mousepad and press "send" and it "transfers" the document from the AlphaSmart to the computer by typing it. Linux just thinks it is a keyboard plugged in that is typing.

When it comes to accented characters, it sends emulated ALT key combinations. But Linux doesn't understand those, so I end up with words missing the accents. "Hernán Cortés" is transferred as "Hernn Corts".

Is there a way to setup one single Linux application to accept these ALT codes so I can correctly retrieve the files with accent codes understood? Or is there a way to install an input method, such as through ibus that will accept ALT codes?

  • 1
    What are ALT codes? Can you give an example? are you thinking of unicode characters? What Linux are you using? More importantly, what desktop environment and what keyboard layout? Does it work as you expect if you use a keyboard layout with "Dead keys"? – terdon Jul 19 '19 at 12:50
  • In Windows, you could type ALT plus a four-digit number to type in a special character. sites.psu.edu/symbolcodes/windows/codealt For instance, I used to type ALT+0176 to get the ° symbol to appear. I don't know if current versions of Windows still does this. I have the latest Debian with a US keyboard layout. I don't know how to use a keyboard layout with dead keys. – Village Jul 19 '19 at 12:54
  • Just use whatever GUI you have that lets you choose the keyboard layout and choose "English US, intl., with dead keys". That will let you use the right Alt to enter accents (e.g. LeftAlt+' and then type o and you get ó). – terdon Jul 19 '19 at 12:57
  • @terdon but that doesn’t help with the AlphaSmart input involved in the question :-(. – Stephen Kitt Jul 19 '19 at 12:58
  • What I'm saying is the AlphaSmart doesn't type LeftAlt+o, it types ALT+0243 when it wants to enter ó, and I can't change that behavior. How can I get Linux or one application at least to understand the ALT codes? – Village Jul 19 '19 at 12:59
1

I'm not aware of any Linux input method which understands the MS-Windows style Alt+number input.

But you only need it to paste text from this external machine you own, so maybe this little Tcl script I wrote helps. It's a minimal text editor emulating those MS-Windows Alt+nnnn key sequences.

#!/usr/bin/wish

text .t
pack .t -fill both -expand yes

set buf {}
proc pressed {digit} {
    append ::buf $digit
    if {[string length $::buf] == 4} {
        .t insert insert [format %c [string trimleft $::buf 0]]
        set ::buf {}
    }
}

foreach k {0 1 2 3 4 5 6 7 8 9} {
    bind .t <Alt-KeyPress-$k> [list pressed $k]
}

You need Tcl and Tk to run it on your Linux box. Tell me if it works or if there are problems.

| improve this answer | |
0

In most (all?) popular desktop environments, if you press Ctrl+u and then a Unicode code number, you will get the corresponding unicode character. For example, to get Ë, you would press Ctrl+u and then type 00cb.

Alternatively, switch to a layout with dead keys and this will let you enter accents using AltGr (right alt key). For example:

  • AltGr+' and then i gives í;
  • AltGr+` and then i gives ì;
  • AltGr+" and then i gives ï;
  • AltGr+: and then i gives °;
| improve this answer | |
  • The AlphaSmart stores text that I type. When I'm done with my file, I connect it to the PC with a USB cable, and press "Send" on the AlphaSmart, it, not me, types in the text. It emulates a person typing on the keyboard to transfer text to the computer. When connected to Linux, it detects a PC, and so it uses Windows-style ALT codes. I can't tell it to enter an alternative type of code, such as those you list here, it isn't so customization. – Village Jul 19 '19 at 13:15
  • @Village yeah, this is unlikely to help you. I'll leave it here in case it helps someone with a similar problem though. – terdon Jul 19 '19 at 13:22
  • That is okay, most people who actually use an AlphSmart aren't understanding how it works either. – Village Jul 19 '19 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.