Al la enhavo

Best Windows 7 input method for Esperanto

de Zvoc47, 2015-oktobro-24

Mesaĝoj: 15

Lingvo: English

marcuscf (Montri la profilon) 2015-oktobro-29 13:40:56

Zvoc47:I don't understand Esperanto enough to read the code comments. Can you show me which line of code I need to change? Also, I don't know how to compile a program without putting it into a Visual Studio solution or CodeBlocks project. How am I supposed to then publish it according to GPL if it will be tied to Visual Studio?
If you send a modified version to somebody else, just be sure to make the source is available and it'll be OK. There are free versions of Visual C++ and lots of free software use it when compiling for Windows.

You can compile it by simply creating a Visual Studio Solution (Windows C++ program, Unicode, static linking, no MFC, no .NET, no anything else) and pasting the source code there. It will probably work on CodeBlocks too, you will only need to find the right place in its user interface to put the -mwindows -municode -DWINVER=0x0400 options.

First try to compile it as it is, and if you want to make changes start reading the code here:
SimplaTajpi.cpp line 234, at "switch(signo)".

At that point you have the key that the user typed (signo). If you need to wait for the next key, store it in bufro; if you want to do the conversion, see the function SendiEo.

Remember that Tajpi is free software too, I just created a C++ version of its core.

Zvoc47 (Montri la profilon) 2015-oktobro-29 17:57:53

Oh. So this program makes "c" and "x" turn into "ĉ". Right? How do I make an AltGr+3 and "c" turn into "ĉ"? I'm confused right there. I don't know what's the keyboard code for the deadkeys.

marcuscf (Montri la profilon) 2015-oktobro-29 20:13:25

Zvoc47:Oh. So this program makes "c" and "x" turn into "ĉ". Right?
Exactly.

Zvoc47:How do I make an AltGr+3 and "c" turn into "ĉ"? I'm confused right there. I don't know what's the keyboard code for the deadkeys.
I don't know them either malgajo.gif
You'll have to experiment a little with hookStruct->vkCode, MapVirtualKeyEx(), and GetKeyState().
If I have time to test a few things, I will share with you some of my findings. Otherwise, you can try reading Tajpi's source code. Last time I checked (Tajpi 2.90), the equivalent code was in a source file called ModKeyboard.bas and it had some extra code for dead key handling.

eshapard (Montri la profilon) 2015-oktobro-30 20:22:01

I wrote a little script for this in autohotkey. It automatically converts cx to ĉ, hx to ĥ, etc. when I'm typing.

I run this on my work computer, which runs Windows 7. For linux, something similar can be done with autokey.

If you download autohotkey, you can use this script and you can modify it as you wish.

Note 1: ŭ is formed with vx instead of ux because ux shows up in a few words.

Note 2: find an icon for this script and name it esperanto-icon.ico or delete the second and third lines.

Note 3: Sometimes the script gets stuck (don't know why), so the WakeZombie function reloads it periodically.
#SingleInstance force
FileInstall, esperanto-icon.ico, %A_Temp%\esperanto-icon.ico, 1
Menu, tray, Icon, %A_Temp%\esperanto-icon.ico

SetTimer, WakeZombie , 100000
return

WakeZombie:
reload
return

:c*?:cx::ĉ
:c*?:Cx::Ĉ
:c*?:gx::ĝ
:c*?:Gx::Ĝ
:c*?:hx::ĥ
:c*?:Hx::Ĥ
:c*?:jx::ĵ
:c*?:Jx::Ĵ
:c*?:sx::ŝ
:c*?:Sx::Ŝ
:c*?:vx::ŭ
:c*?:Vx::Ŭ
If you want to use the altgr key instead of x, you could change the codes to:
:c*:<^>!c::ĉ
for example, and I think that would do what you want, but I haven't tested it. I don't have an altgr key.

Autokey is pretty easy to learn and you don't have to compile the scripts.

RiotNrrd (Montri la profilon) 2015-oktobro-30 20:59:17

Here's is a keyboard mapping I made many years ago, on a Vista system, using a tool that Microsoft created just for making keymaps. I just tried it out on Windows 7 and it works just fine.

Keymap

Unzip it, drive down into it until you find Setup.exe, and run it. Bear in mind that I take no responsibility whatsoever for any damage that running it might cause, and will not offer technical support: you use this software at your own risk. However, I can confirm that *I* built this, not some random guy on the internet, and that it is what I say it is and not some virus-infected malware.

It will put a little keyboard in your taskbar, with US English and Esperanto choices (sorry non-US-keyboard people, I made this for me, mainly).

Switch to Esperanto and six of the keys are remapped (QWXY and I think two of the punctuation keys - I haven't used it in a while and don't remember, although now that I've proven to myself that it works on Win 7 I'm going to be using it all the time). So you type a Q, and out comes a Ŝ (for example, and which I just used it to type the Ŝ). It allows you to easily switch between the keyboards either with a mouse or with a keyboard shortcut (actually, it looks like the keyboard shortcut may not work on Win 7, but everything else appears to).

Reen al la supro