Author Topic: message pump variant X64  (Read 733 times)

tenkey

  • Regular Member
  • *
  • Posts: 24
Re: message pump variant X64
« Reply #30 on: January 12, 2021, 02:19:13 PM »
The main thing is that TranslateMessage processes keyboard messages, and generates new keyboard messages. The edit boxes expect specific messages for keyboard input, and it's not EN_CHANGE. That notification comes from the edit box after it has updated its display, so the parent window can retrieve the edit box text. My recollection is that it was a pain to use, because it was also sent each time a keyboard character was accepted.

I don't know how much non-numerical keyboarding you expect to be doing. Will you be using '.' or '-'? Are you using a US keyboard? The raw WM_KEYUP and WM_KEYDOWN messages don't send ASCII codes. The ASCII codes are what you need in those edit boxes.

If the digit keys are the only keys you use, then you might get away with just PostMessage WM_CHAR when you get a digit key press. Otherwise, your TranslateMessage replacement will need to monitor for shift key presses and releases to know when the shift keys are up or down. And then you will need to make a translation from virtual key code to (ASCII/Unicode) character code depending on whether the shift keys are up or down. You can probably ignore IME messages if your computer is using a language that doesn't need IME (a special keyboard input procedure).

daydreamer

  • Member
  • *****
  • Posts: 1458
  • building nextdoor
Re: message pump variant X64
« Reply #31 on: January 12, 2021, 10:34:53 PM »
If the digit keys are the only keys you use, then you might get away with just PostMessage WM_CHAR when you get a digit key press. Otherwise, your TranslateMessage replacement will need to monitor for shift key presses and releases to know when the shift keys are up or down. And then you will need to make a translation from virtual key code to (ASCII/Unicode) character code depending on whether the shift keys are up or down. You can probably ignore IME messages if your computer is using a language that doesn't need IME (a special keyboard input procedure).
I have some code that uses unicode richedit control,using exotic languages,one of the languages is japanese,so now the IME is a helper interface to easily write asian languages,but you go must go in setup the usual text editors with desired language in control panel,before it starts to work,japanese you write on the usual western keyboard and first it turns your text to hiragana/katakana unicode chars (consonant/vocal combos )and also translates words into right kanji character(whole word)
but is interesting if possible to call some api,to get your own richedit control prepared to IME,is it the right .dll file with its own IME api you can invoke this translation instead of write your own ?
SIMD fan and macro fan
Happy new year 2021 that can only turn out to become better than worse 2020 :)

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 8027
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: message pump variant X64
« Reply #32 on: January 13, 2021, 04:28:11 AM »
IME is usually determined by the country/language version of the OS Right to left scripts (Arabic, Hebrew). The documentation for IME messaging appears to depend on if you have an Asian language OS version. It may be possible for a European language OS version but I have not seen it done.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

daydreamer

  • Member
  • *****
  • Posts: 1458
  • building nextdoor
Re: message pump variant X64
« Reply #33 on: January 14, 2021, 03:21:02 AM »
Hutch
Easy part usage of Japanese language pack and IME with simplistic hiragana and katakana, can be made with code that does that without IME, replacing "sayonara", to exchange SA,yo,na,ra with hiragana unicode characters is possible

But when you want the words to be translated to Chinese /japanese /Korean unicodes about 30k of them,I can't, need to be some expert on Chinese characters, to be able to create that
So that it would be interesting todo it with help of call  IME functions if there is such a library
SIMD fan and macro fan
Happy new year 2021 that can only turn out to become better than worse 2020 :)