Jump to content
Sign in to follow this  
czardas

Extended ANSI hotkey issue

Recommended Posts

czardas

I want to input various characters into an Edit box. I wanted to use hotkeys similar to Microsoft Word so as not to confuse myself. So I tried HotKeySet ("^`", "gravea") which calls on a fuction which selects one of the vowels a, e, i, o, or u depending on the three keys pressed. This works for e, o & u but with the other vowels (a and i). I get SelectAll or the default windows hotkey for 'indent'. So then I thought I would change the ^ to ! (control changed to alt). Now the letter 'e' is a problem because it opens the Edit menu. So it appears that these hot keys will not work. I have tried to get around this problem in different ways. At the moment I am trying to get string replace to work for me

Func gravea()
    ;first backup the clipboard data
    $clip = ClipGet()
    Send("^c")
    ;this part looks like a problem because the control key is already pressed with the hotkey sequence. Hmm???
    $text = ClipGet()
    $text = StringReplace($text, "a", "à", 0, 1)
    $text = StringReplace($text, "e", "è", 0, 1)
    $text = StringReplace($text, "i", "ì", 0, 1)
    $text = StringReplace($text, "o", "ò", 0, 1)
    $text = StringReplace($text, "u", "ù", 0, 1)
    _GUICtrlEditReplaceSel($Edit_1, 1, $text)
    ;Return the clipboard data  
    ClipPut($clip)
EndFunc

Anyway this particular function seems to work fine with the Right control key. But if the left control key is pressed then I get a sticky control key effect, rendering my computer inopperable and requiring a forced restart. I just noticed the possible cause as I typed this message (please see comments in code). I have searched the forum and am now getting a little tired of trying to fathom this out. I have tried to reset default hotkeys without success. I would like to know if anyone has tackled this problem or does anyone know of a better method (a working method) independant of what I have tried. Or can you see an obvious fix, either fool the right Control key into thinking it is the left control key (is there really a difference or is there something wrong with my keyboard or win2k pro opperating system) or can I clear default windows hotkeys temporarily while the program is running?

I hope this is clear. :P

EDIT: I should explain. At first, I tried sending characters to the Ediit box. I switched to the string replace method which requires the letters first to be selected and then altered. I actually don't care which method is used so long as it is not too complicated for the user.

On reflection perhaps there is an issue with the opperating system. But I would like the application to run on both Win2k and xp. Oh, and Vista when they finish it.

Edited by czardas

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.