AutoHotkey Community

It is currently May 27th, 2012, 1:15 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: June 21st, 2008, 1:50 am 
Offline

Joined: October 29th, 2006, 4:09 am
Posts: 39
Location: A2 MI
Hey all... I've been a fan of AHK for ages, as well as several GTK+ based programs on windows (i.e. GAIM / Pidgin, GIMP, and Inkscape)

Some of my most commonly used hotstrings are for characters like üäößÜÄÖ, etc. Those are the additional characters for German, which I've been in the slow process of learning for years. é is useful for the word pokémon... haha.

I implement these like this:
Code:
:c?*:uuU::Ü
:c?*:ooO::Ö
:c?*:aaA::Ä
:c?*:sS::ß
:c?*:oO::ö
:c?*:aA::ä
:c?*:uU::ü
:c?*:eE::é


Typing that stuff is second nature... and it's only a problem when stringing together words with no spaces... such as the occasional filename or going SSSssssssssssssssßSSSSsssssssssss. Not a very common problem, and fixable by just doing 's S' and going back and deleting the space.

When using a GTK+ program, however, those don't work. Hotstrings with regular characters do work, but not special characters. This is an ancient problem... and you'll find a few threads with search about this.

The fundamental flaw is that GTK+ uses input or encoding or something that is hex based. As my uncertainty there indicates, I don't know a ton about this, and knowing that fact didn't help me much. "Hex" doesn't get many results when you search for it here :)

I got clued in a few weeks ago though when reading a random email on the Pidgin developers list (I read but don't contribute, for I lack knowledge of that sort... it's still interesting). Lo and behold, someone mentions that Alt + ### doesn't work, and one of the developers replies that you need to use Ctrl + Shift + u + ## where the two ## are the hex code for that character. VOILA!

Next I found that a hotstring works for ü:
Code:
:c?*:uuU::^+uDC

In that case, DC is the hex code for the character... and it works!

Next I simply used #IfWinActive to identify all GTK+ windows. So far this works for all GTK+ windows I've tried:
Code:
#IfWinActive, ahk_class gdkWindowToplevel


And then I set up the rest of them after finding a page listing Hex codes.
(http://www.indwes.edu/faculty/bcupp/things/latin1.htm)
Code:
:c?*:uuU::^+uDC
:c?*:ooO::^+uD6
:c?*:aaA::^+uC4
:c?*:sS::^+uDF
:c?*:oO::^+uF6
:c?*:aA::^+uE4
:c?*:eE::^+uE9


And tested... What do I get?
ü ö ä Ü Ö Ä ß é ---> ü 6 4 Ü 6 4 ß 9

So that didn't quite work.... If I compare the list with the hex codes in the set of hotstrings, I notice that all the ones with hex codes ending in numbers trigger prematurely or something. What it's sending instead is the hex characters D C F and E. Those are whitespace characters, iirc; D is Carriage Return, C is New Paragraph, A is New Line, B is Vertical Tab, etc.

And that has me stumped. How do I get it to interpret the number too and THEN send the special character?

Thanks in advance; and if you find this in the future, searching for a solution to this same general trick... hope it helps!

•Gertlex

Edit: Experimented a bit more today... turns out using lowercase letters solves the problem in all but one of the cases.

The final list:
Code:
:c?*:uuU::^+uDC
:c?*:ooO::^+ud6
:c?*:aaA::^+uc4
:c?*:sS::^+uDF
:c?*:oO::^+uf6
:c?*:aA::^+ue4
:c?*:eE::^+ue9
:c?*:_-::- ; ^+uAF
:?*:*?*::^+uBA^+uBF^+uBA
:?*:+or-::^+ub1

The last one doesn't work, however. It should produce ±, but doesn't work. Oh well. It's the least used of those.


Last edited by Gertlex on June 23rd, 2008, 5:02 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
PostPosted: June 21st, 2008, 2:45 am 
Offline

Joined: June 21st, 2008, 2:28 am
Posts: 5
Gertlex wrote:
é is useful for the word pokémon... haha.
Funny? :?:


Report this post
Top
 Profile  
Reply with quote  
PostPosted: June 21st, 2008, 4:07 am 
Offline

Joined: October 29th, 2006, 4:09 am
Posts: 39
Location: A2 MI
J F S B 3 wrote:
Gertlex wrote:
é is useful for the word pokémon... haha.
Funny? :?:


Because i'm an adult, and it's amusing how often it ends up being a word that gets used.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 7th, 2008, 5:01 pm 
Offline

Joined: August 7th, 2008, 4:53 pm
Posts: 5
i use latin characters within pidgin sometimes and found out how to do them.

for example to write ñ i used:

Code:
:*:~n::{Ctrl Down}{Shift Down}u{Shift Up}{Ctrl Up}00f1{space}


when you do shift+control+u you can type in a unicode value such as 00f1

for example doing Ö which in unicode equals as: 00F6 i would do:

Code:
:*:oO::{Ctrl Down}{Shift Down}u{Shift Up}{Ctrl Up}00F6{space}


the space at the end is needed for the char to show up, but it won make a space.

anyway

hope this helps.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Amandaville, BrandonHotkey, chaosad, Yahoo [Bot] and 25 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