AutoHotkey Community

It is currently May 27th, 2012, 12:08 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: March 16th, 2011, 9:13 pm 
Offline

Joined: August 17th, 2004, 7:05 pm
Posts: 38
Hi guys,
I have a german keyboard but US WinWord 2007. Usually, to adjust font sizes you press ^+< and ^+> -- or ^[ and ^] for point-size adjustment.

However, on my German keyboard that does not work: the [ and ] requires AltGr to be pressed. < and > are on the same key with shift, so difficult to use the ^+< and ^+> combinations (as they are the same key - so making font smaller works, but not larger).

Any help available?

_________________
Cheers,

Thorsten


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 16th, 2011, 9:41 pm 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6074
Location: San Diego, California
Is pressing AltGr that difficult?

It seems like you just press the right 'alt' , but perhaps I am wrong.

http://www.autohotkey.com/docs/commands/Send.htm
Key Names: The following table lists the special keys that can be sent (each key name must be enclosed in braces):

{RAlt} Right ALT key (or AltGr, depending on keyboard layout)

Here is a script that might be useful.
Code:
!8::send ^+<
!9::send ^+>
esc::exitapp


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 17th, 2011, 1:30 am 
Offline

Joined: August 17th, 2004, 7:05 pm
Posts: 38
No, pressing altgr is not difficult :)

However, because you press a special modifier winword does not accept it as "ctrl + [" but instead types the "["

I already tried your approach - this was my first thought as well, adding also a KeyWait (EDIT: 5.57pm) and SendInput instead of the Send. For some reason it exactly produces the same behavior as press ing the key combination (scale down works, scale up doesn't).

Can someone with a US keyboard send me the VK code that is sent whhen pressing "[" and "]"? Maybe that helps.

_________________
Cheers,

Thorsten


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 17th, 2011, 1:56 am 
Offline

Joined: August 17th, 2004, 7:05 pm
Posts: 38
Quick and dirty "solution" (ouch!):
Code:
   ^,::
;      KeyWait, Control
      SendInput, !hfs{down}{up}{enter}
   Return
   
   ^.::
;      KeyWait, Control
      SendInput, !hfs{down}{down}{enter}
   Return

_________________
Cheers,

Thorsten


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 17th, 2011, 5:46 am 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6074
Location: San Diego, California
thinkstorm wrote:
Can someone with a US keyboard send me the VK code that is sent whhen pressing "[" and "]"? Maybe that helps.

If you mean a vk code when pressing both key simultaneously, there is none. :roll:

If you mean of those keys themselves, then here are 4 press & releases of each key. Along with some window switching. :wink:
Code:
Window: C:\Users\Leef_me\Documents\Autohotkey\key_history.ahk - AutoHotkey v1.0.48.05
Keybd hook: yes
Mouse hook: yes
Enabled Timers: 0 of 0 ()
Interrupted threads: 0
Paused threads: 0 of 0 (0 layers)
Modifiers (GetKeyState() now) =
Modifiers (Hook's Logical) =
Modifiers (Hook's Physical) =
Prefix key is down: no

NOTE: To disable the key history shown below, add the line "#KeyHistory 0" anywhere in the script.  The same method can be used to change the size of the history buffer.  For example: #KeyHistory 100  (Default is 40, Max is 500)

The oldest are listed first.  VK=Virtual Key, SC=Scan Code, Elapsed=Seconds since the previous event.  Types: h=Hook Hotkey, s=Suppressed (blocked), i=Ignored because it was generated by an AHK script, a=Artificial, #=Disabled via #IfWinActive/Exist.

VK  SC   Type   Up/Dn   Elapsed   Key      Window
-------------------------------------------------------------------------------------------------------------
0D  01C       d   1.98   Enter             key_history.ahk
0D  01C       u   0.11   Enter             C:\Users\Leef_\Documents\Autohotkey\key_history.ahk - AutoHotkey v1.0.48.05
A4  038       d   0.48   Alt               
09  00F       d   0.09   Tab               
09  00F       u   0.22   Tab               Task Switching
09  00F       d   0.22   Tab               
09  00F       u   0.16   Tab               
A4  038       u   0.73   Alt               
DB  01A       d   1.50   [                 Document1 - Microsoft Word
DB  01A       u   0.09   [                 
DB  01A       d   0.13   [                 
DB  01A       u   0.08   [                 
DB  01A       d   0.34   [                 
DB  01A       u   0.13   [                 
DB  01A       d   0.17   [                 
DB  01A       u   0.12   [                 
DD  01B       d   0.81   ]                 
DD  01B       u   0.14   ]                 
DD  01B       d   0.11   ]                 
DD  01B       u   0.13   ]                 
DD  01B       d   0.13   ]                 
DD  01B       u   0.11   ]                 
DD  01B       d   0.30   ]                 
DD  01B       u   0.13   ]                 
A4  038       d   0.77   Alt               
09  00F       d   0.20   Tab               
09  00F       u   0.19   Tab               Task Switching
A4  038       u   0.73   Alt               
74  03F       d   1.22   F5                C:\Users\Leef_me\Documents\Autohotkey\key_history.ahk - AutoHotkey v1.0.48.05
Press [F5] to refresh.


In addition, I recorded the following actions:
1. open a script with key_history being used
2. alt-tab to msWord and type this (all lower case)
3. control-shift= several times to increase font size
4. control-shift- several times to decrease font size

5. control ] several times to increase font size
6. control [ several times to decrease font size

7. alt-tab back to the keyhistory script
8. F5 to update the key_history window
9. F1 (not shown) to save the key_history window to the clipboard


Code:
Window: C:\Users\Leef_me\Documents\Autohotkey\key_history.ahk - AutoHotkey v1.0.48.05
Keybd hook: yes
Mouse hook: yes
Enabled Timers: 0 of 0 ()
Interrupted threads: 0
Paused threads: 0 of 0 (0 layers)
Modifiers (GetKeyState() now) =
Modifiers (Hook's Logical) =
Modifiers (Hook's Physical) =
Prefix key is down: no

NOTE: To disable the key history shown below, add the line "#KeyHistory 0" anywhere in the script.  The same method can be used to change the size of the history buffer.  For example: #KeyHistory 100  (Default is 40, Max is 500)

The oldest are listed first.  VK=Virtual Key, SC=Scan Code, Elapsed=Seconds since the previous event.  Types: h=Hook Hotkey, s=Suppressed (blocked), i=Ignored because it was generated by an AHK script, a=Artificial, #=Disabled via #IfWinActive/Exist.

VK  SC   Type   Up/Dn   Elapsed   Key      Window
-------------------------------------------------------------------------------------------------------------
0D  01C       d   2.28   Enter             key_history.ahk
0D  01C       u   0.09   Enter             C:\Users\Leef_me\Documents\Autohotkey\key_history.ahk - AutoHotkey v1.0.48.05
A4  038       d   0.34   Alt               
09  00F       d   0.09   Tab               
09  00F       u   0.17   Tab               Task Switching
09  00F       d   0.52   Tab               
09  00F       u   0.17   Tab               
A4  038       u   0.13   Alt               
54  014       d   1.37   T                 Document1 - Microsoft Word
54  014       u   0.09   T                 
48  023       d   0.09   H                 
48  023       u   0.11   H                 
49  017       d   0.39   I                 
49  017       u   0.11   I                 
53  01F       d   0.17   S                 
53  01F       u   0.12   S                 
A0  02A       d   0.47   Shift             
A0  02A       d   0.53   Shift             
A0  02A       d   0.03   Shift             
A0  02A       d   0.03   Shift             
A0  02A       d   0.05   Shift             
24  147       d   0.05   Home              
24  147       u   0.14   Home              
A0  02A       u   0.47   Shift             
A2  01D       d   1.34   Ctrl              
A0  02A       d   0.31   Shift             
A0  02A       d   0.53   Shift             
A0  02A       d   0.03   Shift             
A0  02A       d   0.03   Shift             
A0  02A       d   0.05   Shift             
A0  02A       d   0.03   Shift             
A0  02A       d   0.05   Shift             
A0  02A       d   0.03   Shift             
A0  02A       d   0.03   Shift             
A0  02A       d   0.05   Shift             
A0  02A       d   0.03   Shift             
A0  02A       d   0.05   Shift             
BE  034       d   0.00   .                 
BE  034       u   0.09   .                 
BE  034       d   0.14   .                 
BE  034       u   0.09   .                 
BE  034       d   0.14   .                 
BE  034       u   0.11   .                 
BE  034       d   0.16   .                 
BE  034       u   0.11   .                 
BE  034       d   0.16   .                 
BE  034       u   0.11   .                 
BC  033       d   0.94   ,                 
BC  033       u   0.11   ,                 
BC  033       d   0.14   ,                 
BC  033       u   0.09   ,                 
BC  033       d   0.16   ,                 
BC  033       u   0.11   ,                 
BC  033       d   0.14   ,                 
BC  033       u   0.11   ,                 
BC  033       d   0.19   ,                 
BC  033       u   0.08   ,                 
A0  02A       u   0.34   Shift             
DD  01B       d   0.94   ]                 
DD  01B       u   0.11   ]                 
DD  01B       d   0.14   ]                 
DD  01B       u   0.09   ]                 
DD  01B       d   0.13   ]                 
DD  01B       u   0.11   ]                 
DD  01B       d   0.11   ]                 
DD  01B       u   0.13   ]                 
DD  01B       d   0.13   ]                 
DD  01B       u   0.11   ]                 
DB  01A       d   0.84   [                 
DB  01A       u   0.11   [                 
DB  01A       d   0.11   [                 
DB  01A       u   0.11   [                 
DB  01A       d   0.13   [                 
DB  01A       u   0.11   [                 
DB  01A       d   0.14   [                 
DB  01A       u   0.11   [                 
DB  01A       d   0.14   [                 
DB  01A       u   0.11   [                 
A2  01D       u   0.64   Ctrl              
A4  038       d   1.15   Alt               
09  00F       d   0.20   Tab               
09  00F       u   0.17   Tab               Task Switching
A4  038       u   0.87   Alt               
74  03F       d   1.73   F5                C:\Users\Leef_me\Documents\Autohotkey\key_history.ahk - AutoHotkey v1.0.48.05
Press [F5] to refresh.


And here is the key_history script I used
Code:
#persistent
#InstallKeybdHook
#InstallMouseHook

message=
(
The window behing this message is the Key History Window

type a few keys '123'
               and then hit F5

Do you see them in the key history?

press the mouse button
               then hit F5 again

do you see what button was pushed?

)

KeyHistory ; Display the history info in a window.

msgbox %message%

#KeyHistory 100

;KeyHistory ; Display the history info in a window.


esc::exitapp   ; press escape key to exit script

f1::
WinGetText, clipboard, A
return



Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 17th, 2011, 9:07 pm 
Offline

Joined: August 17th, 2004, 7:05 pm
Posts: 38
Thank you, Leef_me, for your help! Unfortunately it didn't solve the problem... I tried all sorts of SendEvent, SendPlay, SendInput, SendControl, .... with ^{vkDDsc01B}, didn't work :(

I guess short of calling the DLL functions I will stick with the dirty version. Which is a pain because it changes the ribbon.

_________________
Cheers,

Thorsten


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 17th, 2011, 9:20 pm 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6074
Location: San Diego, California
http://www.autohotkey.com/docs/commands/Send.htm

Key Names: The following table lists the special keys that can be sent (each key name must be enclosed in braces):


{vkXX}
{scYYY}
{vkXXscYYY}
Sends a keystroke that has virtual key XX and scan code YYY. For example: Send {vkFFsc159}.
If the sc or vk portion is omitted, the most appropriate value is sent in its place.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], BrandonHotkey, Google Feedfetcher and 17 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group