> [...]
> when the Input Language Is selected as English(United States) when I
[quoted text clipped - 10 lines]
> States)
> to French (France) the text should also change from 12346 to &é"'(-
If I understand correctly, the text that should change is the text
displayed in the text box itself.
> Earlier someone said me it is not possible until I record the keystrokes
> that are being entered into the richtextbox..
That sounds about right. Not only would you need to record the
keystrokes, presumably you'd need some way to send those keystrokes
through the input language-dependent code and rebuild the text box text
from the logged keystrokes. Of course, not all keystrokes create a
character in the text box, so you also may need some way of accounting for
those (unless you literally just want to play back the user's entire input
sequence every time you need to rebuild the text box's text).
Of course, assuming this is really supposed to be a text editor, then you
still have the problem of what to do with saving or loading a text file.
It's one thing to maintain all this meta-data about the inputed text
during your program's execution. But it's not like you can save that
meta-data with the text file.
It seems to me that for a variety of reasons, you might find it's more
productive to somehow come up with a mapping for characters generated with
the input in one language to those generated for the same input in another
language. Unfortunately, I expect that may be fraught with pitfalls as
well, given that keyboard input and text characters don't really have a
one-to-one mapping (in spite of their close relevance to each other).
In any case, the KeysConverter class is, according to the documentation,
mainly used for translating the _names_ of the Keys instances, not the
generated text itself. There might be some overlap there, but I doubt
it's actually going to do what you want here.
Pete
Rajkiran R.B. - 12 Dec 2007 09:57 GMT
Thanks for the reply there.. Well can u please help in recording he
keystrokes...
and I tried the sendkeys method from the
Microsoft.VisualBasic.Devices.Keyword class.. However I ended up in getting
the same text again..
I would like to know how to capture the keystrokes and send it back as an
input to the richtext...
Assuming that all the text will be Entered manually and no pasting are
loading from file is implemented...
I used the following but I noticed that it captures only the character and
not the keystroke itself..
System.Collections.Queue keyobj = new System.Collections.Queue();
private void richTextBox1_KeyPress(object sender, KeyPressEventArgs
e)
{
keyobj.Enqueue(e.KeyChar);
}
> If I understand correctly, the text that should change is the text
> displayed in the text box itself.
> That sounds about right. Not only would you need to record the
> keystrokes, presumably you'd need some way to send those keystrokes
[quoted text clipped - 23 lines]
>
> Pete
Family Tree Mike - 12 Dec 2007 13:47 GMT
> Thanks for the reply there.. Well can u please help in recording he
> keystrokes...
>
> and I tried the sendkeys method from the
> Microsoft.VisualBasic.Devices.Keyword class.. However I ended up in getting
> the same text again..
I'm not familiar with that class. The SendKeys that I refered to would be
Windows.Forms.SendKeys.
Peter Duniho - 12 Dec 2007 19:02 GMT
> Thanks for the reply there.. Well can u please help in recording he
> keystrokes...
Keep in mind that I basically know nothing about the things you're trying
to solve. All I can comment on is what I read in the documentation and
whether what someone else says _seems_ to make sense (I have no way to
know for sure it does or does not).
> and I tried the sendkeys method from the
> Microsoft.VisualBasic.Devices.Keyword class.. However I ended up in
> getting the same text again..
> [...]
> I used the following but I noticed that it captures only the character
> and not the keystroke itself..
Well, I don't know whether the difference between the SendKeys() you're
using and the SendKeys() in the Forms namespace is significant. However,
at the very least I would expect that you'd need to use the KeyDown event,
rather than the KeyPress. By the time the data gets to KeyPress, it's
already been translated into an actual character. You seem to be wanting
to tie the input to the actual key being pressed, and the KeyDown event is
what provides that information.
Whether you'll be able to use that data with any version of SendKeys() I
can't say.
Pete