Jump to content



Photo

MJK


  • Please log in to reply
3 replies to this topic

#1 CoePSX

CoePSX

    Polymath

  • Active Members
  • PipPipPipPip
  • 237 posts

Posted 15 January 2007 - 12:46 AM

EDIT: Latest version with source-code at http://sourceforge.net/projects/mjk/

Well, this is not autoit, but I believe it can be useful to some people who know a little japanese or want to learn it.

This is a little tool I made to make easy typing simple japanese text (No Kanjis).

It's fully written in C, and it's very simple to understand, since the principles can be easily adapted to autoit.
I did it in C because at work I can't have AutoIt, but I have Visual Studio 2005 (that crappy one) with C++ compiler. Most of it was written there, I just made icons and compiled at home using Pelles C.

This is how it works:
 - The program registers a hotkey for every letter key and some special keys using RegisterHotkey.
 - The hidden window receives the hotkey messages, and it uses a temporary string to parse the japanese letters.
 - The user-interface is limited to a interactive tray icon.

Works by just typing things in japanese. Like the sentence "Boku wa kirei desu ne."
Becomes ぼく わ きれい です ね。It has katakana letters too. :)

Don't get scared by the code. 95% of it are just switches and cases to handle the letter combinations.

And yes, I always give ridiculous names to my programs, most of them starting with the word Magic. :D

I hope someone can find some use to it.
The executable with source code and Pelles C project is attached.

If you find any bugs, tell me so I can fix it. Any comments are welcome. :D

EDIT: See update on post below.

Attached Files

  • Attached File  MJK.zip   45.09K   90 downloads

Edited by CoePSX, 21 June 2007 - 02:45 AM.

You seem to have a habit of putting things in the wrong place. I feel sorry for any female you attempt to have sex with.






#2 NELyon

NELyon

    Do you wanna brew my avatar?

  • Active Members
  • PipPipPipPipPipPip
  • 3,526 posts

Posted 15 January 2007 - 01:39 AM

ああ、すごい! とてもすごいです!!!

^^ Thats with my IME ^^

BB, YTD hf‚YTDgY

^^ That's with the program ^^

Maybe i did something wrong?

If i could get this to work, maybe it could replace my IME. I set it to hiragana, and typed in "aa, sugoi. totemo sugoi desu"


Maybe it's just my pc. If so then good job CoePSX-San. I've actually been studying japanese for about a year.

#3 CoePSX

CoePSX

    Polymath

  • Active Members
  • PipPipPipPip
  • 237 posts

Posted 15 January 2007 - 07:22 PM

Yes, I noticed it didn't work on lots of windows. It was using the same method AutoIt does to send unicode chars on last case, by doing Alt+0xxxx simulation.

I adapted it to use SendInput now. Since Windows 95 doesn't support it, it has a compatibility replacement.

Plain Text         
void SendUnicode (wchar_t iUnicode) {     // Add 60h to the unicode if it's in katakana mode //     if (iMode == MODE_KATAKANA)         if ((iUnicode <= LETTER_N) && (iUnicode >= LETTER_SMALLA))             iUnicode += 0x60;     // Send the character //     if (bNT)         _SendUnicodeNT (iUnicode);     else         _SendUnicode95 (iUnicode);     return; } void _SendUnicode95 (wchar_t iUnicode) {     char szUnicode[8];     int i;     int iLen;         // Make a 0XXXX string //     sprintf (szUnicode, "0%d", iUnicode);     iLen = strlen (szUnicode);     // Send the ALT+0XXX combination //     keybd_event (VK_MENU, 0, 0, 0);     for (i=0; i<iLen; i++)         SendKey (VkKeyScan (szUnicode[i]) + 0x30);     keybd_event (VK_MENU, 0, KEYEVENTF_KEYUP, 0);         return; } void _SendUnicodeNT (wchar_t iUnicode) {     INPUT stInput = {0};     stInput.type = INPUT_KEYBOARD;     stInput.ki.wScan = iUnicode;     stInput.ki.dwFlags = KEYEVENTF_UNICODE;     // Here we use SendInput to send the character //     SendInput (1, &stInput, sizeof(INPUT));     return; }

I changed the version to 0.4, and it's attached with source code on MJK04.zip. This version should be much better to use than the other one, since it even works on IE 6. :)

EDIT: Invision is playing with my mind.

Attached Files


Edited by CoePSX, 15 January 2007 - 07:25 PM.

You seem to have a habit of putting things in the wrong place. I feel sorry for any female you attempt to have sex with.


#4 NELyon

NELyon

    Do you wanna brew my avatar?

  • Active Members
  • PipPipPipPipPipPip
  • 3,526 posts

Posted 15 January 2007 - 08:35 PM

ああ, すごい です! とてもすごいです!


It works!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users