AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to autoreplace ":" character ?

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
iacchos



Joined: 17 Dec 2009
Posts: 4

PostPosted: Thu Dec 17, 2009 11:57 am    Post subject: How to autoreplace ":" character ? Reply with quote

Hi,

I want to auto replace ":" key to "n" key (to "translate" a powerpoint remote control from english shortkey to french shortkey...)

I tried
Code:
:::n

-> has no effect
Code:
`:::n

-> script is in error Confused

Thanks for your help
Back to top
View user's profile Send private message
Guest






PostPosted: Thu Dec 17, 2009 12:14 pm    Post subject: Reply with quote

u can use the scan code
Back to top
UncleScrooge



Joined: 14 Apr 2009
Posts: 75
Location: Italy

PostPosted: Thu Dec 17, 2009 12:18 pm    Post subject: Reply with quote

Code:

:::MsgBox You've pressed ":"
n::MsgBox You've pressed "n"

b::Gosub bye
Return

bye;
MsgBox You've pressed "b" for bye   ; just to get out
ExitApp


in SciTe:
Search=>Replace=> Find what? :::
Replace with n::
_________________
Intel Centrino @ 2.8GHz
4 GB RAM
WIN XP SP3
Back to top
View user's profile Send private message AIM Address
iacchos



Joined: 17 Dec 2009
Posts: 4

PostPosted: Thu Dec 17, 2009 12:32 pm    Post subject: Reply with quote

Sorry, but
Code:
:::MsgBox You've pressed ":"

works fine, whereas
Code:
:::n

has no effect !!!!!
Stange Twisted Evil

BR
Back to top
View user's profile Send private message
UncleScrooge



Joined: 14 Apr 2009
Posts: 75
Location: Italy

PostPosted: Thu Dec 17, 2009 12:36 pm    Post subject: Reply with quote

or u could try:

Code:
:::Gosub SwapIt

b::Gosub bye
Return

bye:
MsgBox % "You've pressed 'b' for bye"
ExitApp

SwapIt:
MsgBox % "You've pressed  " . A_ThisHotkey
NewHotKey := (A_ThisHotkey = n) ? ":" : "n"
Hotkey, %A_ThisHotkey%, Off
Hotkey, %NewHotKey%, SwapIt
Return

_________________
Intel Centrino @ 2.8GHz
4 GB RAM
WIN XP SP3


Last edited by UncleScrooge on Thu Dec 17, 2009 12:46 pm; edited 2 times in total
Back to top
View user's profile Send private message AIM Address
UncleScrooge



Joined: 14 Apr 2009
Posts: 75
Location: Italy

PostPosted: Thu Dec 17, 2009 12:38 pm    Post subject: Reply with quote

iacchos wrote:
Sorry, but
Code:
:::MsgBox You've pressed ":"

works fine, whereas
Code:
:::n

has no effect !!!!!
Stange Twisted Evil

BR

the first : is the hotkey while the following 2 :: are the hotkey assignment operator:
so if you want to use R

R::
SomeActions

use :

:::SomeActions

use n

n::SomeActions

and not ::n or even worse :::n

that's why ::: works just fine...
_________________
Intel Centrino @ 2.8GHz
4 GB RAM
WIN XP SP3
Back to top
View user's profile Send private message AIM Address
iacchos



Joined: 17 Dec 2009
Posts: 4

PostPosted: Thu Dec 17, 2009 12:45 pm    Post subject: Reply with quote

UncleScrooge wrote:

the first : is the hotkey while the following 2 :: are the hotkey assignment operator

I agree. I want to have "n" each time I type ":"
So, the expression should be
Code:
:::n

As I said,
Code:
:::MsgBox You've pressed ":"

works fine. So
Code:
:::n

should be good to have a "n" for ":" hotkey ??

But this not works Mad

More strange: with
Code:
:::n

the result is to have an hotkey "*" with aotoreplce to ":" Mad Mad
A pb with my french (azerty) keybord and Autohotkey ??


Last edited by iacchos on Thu Dec 17, 2009 12:50 pm; edited 1 time in total
Back to top
View user's profile Send private message
UncleScrooge



Joined: 14 Apr 2009
Posts: 75
Location: Italy

PostPosted: Thu Dec 17, 2009 12:47 pm    Post subject: Reply with quote

Code:
:::Send n

the above works
iacchos wrote:
So
Code:
:::n

should be good to have a "n" for ":" hotkey ??

you must tell AHK what you wanna do... placing an "n" after the :: operator is not enough... I suggest you re-read carefully this
_________________
Intel Centrino @ 2.8GHz
4 GB RAM
WIN XP SP3


Last edited by UncleScrooge on Thu Dec 17, 2009 12:59 pm; edited 3 times in total
Back to top
View user's profile Send private message AIM Address
iacchos



Joined: 17 Dec 2009
Posts: 4

PostPosted: Thu Dec 17, 2009 12:52 pm    Post subject: Reply with quote

Yes Very Happy Very Happy Very Happy
Thanks a lot !
Back to top
View user's profile Send private message
jaco0646



Joined: 07 Oct 2006
Posts: 3113
Location: MN, USA

PostPosted: Thu Dec 17, 2009 4:32 pm    Post subject: Reply with quote

A bit of history.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group