Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to Control AutoText
#1
Hello everyone,

I have used QM's AutoText feature for a while, I have encountered two small problems, I hope someone can provide some suggestions and help, thanks in advance. Smile

1. Control the AutoText to take effect in the input box in a specific program, such as QM's help search box, I don't want to use it in the code editing area or other programs.


2. When I type letters in the search box, the input method will automatically switch to English, which is very convenient in some cases.

Autotext Autotext
Trigger $t     Help - how to add the trigger to the macro
Code:
Copy      Help
/b/i/c/p3

sam :key "sample"


Attached Files Image(s)
   
#2
for #1
two different ways.
If you have a lot of autotext  the first function is probably the easy way to go

Autotext Autotext
Trigger $t /QM     Help - how to add the trigger to the macro
Code:
Copy      Help
/b/i/c/m
sam :sub.Sub1("Sample");;Sample
tex :sub.Sub1("text");;Text

#sub Sub1
function ~text
int hwnd=id(2216 _hwndqm)
if hwnd!=win
,act hwnd
paste text

Autotext Autotext2
Trigger $t     Help - how to add the trigger to the macro
Code:
Copy      Help
/b/i/c/m
sam :int hwnd=id(2216 _hwndqm);act hwnd;"Sample";;;;Sample
#3
@kevin

thanks for your help

I tried it. When I typed in the editing area, it still has a prompt. Can I disable it? Huh

I hope that in the editing area, automatic text is forbidden.

I set the following trigger, but it doesn't work. Huh


Attached Files Image(s)
       
#4
need to use a filter function then will only work in specific id

Autotext Autotext
Trigger $t //FF_AutoText     Help - how to add the trigger to the macro
Code:
Copy      Help
/b/i/c/m
sam :sub.Sub1("Sample");;Sample
tex :sub.Sub1("text");;Text

#sub Sub1
function ~text
key F"{text}"


Function FF_AutoText
Code:
Copy      Help
;/
function# iid FILTER&f

if wintest(f.hwnd "Quick Macros" "QM_Editor" "" 2)
,int c=child
,sel GetWinId(c)
,,case 2216
,,ret iid
#5
if you get this message

Warning: filter-function FF_AutoText of Autotext not found

select FF_AutoText 

   

 click properties button
   

click function properties tab and place a check in
this function is a filter-function
   

click ok and all should work
#6
Thank you very much for your help, the first question has been solved perfectly. Heart

On the second question, I found some information on the Internet. Using autohotkey, I can easily switch the input method. The following is the code. I want to know if there is any way to add the same function to QM. ? Idea

SwitchIME  (Is a function that switches input methods)

Code:
Copy      Help
#ifwinactive ahk_class wndclass_desked_gsk,MsoDockTop

::;c::    ; Input ;c  Switch to Sogou Wubi  

   SelectLeftSpaceChar()

   SwitchIME("Sogou Wubi")

   return
#7
have a look at this

http://www.quickmacros.com/forum/showthr...7#pid28497
#8
The code in the link can switch languages, but I only need to input English.
#9
this is not perfect maybe 99%

but try this

Function KeyboardLangCheck
Trigger !a"Quick Macros" "QM_Editor"     Help - how to add the trigger to the macro
Code:
Copy      Help
int hwnd=TriggerWindow
int l=GetKeyboardLayout(GetWindowThreadProcessId(hwnd 0))
int lo=l&0xffff
if lo <> 1033
,int NewKeybLayout = 0x00000409;; Layout must be already loaded!
,PostMessage(hwnd WM_INPUTLANGCHANGEREQUEST 0 NewKeybLayout)
,PostMessage(hwnd WM_INPUTLANGCHANGE 0 NewKeybLayout)


when qm window becomes active checks input language and switches to english if its not.
#10
I tested it and can't switch successfully. Huh
#11
what english language version  do you have installed? May also need to adjust language settings. worked for me flawlessly on win10 with multiple languages installed(German, chinese simplified and en-us). The code switches to en-us if installed.


will try and test on win7 and see if my results are the same.
#12
Just tested on win7 with 5 different languages installed works on win7 as well.


Forum Jump:


Users browsing this thread: 1 Guest(s)