DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: IDEA: Remap keyboard press value for -one- application  (Read 7,321 times)

ugo

  • Participant
  • Joined in 2005
  • *
  • Posts: 3
IDEA: Remap keyboard press value for -one- application
« on: March 03, 2006, 08:03 AM »
Hi, maybe it's a stupid idea but...

On an italian keyboard (that's it: I'm from Italy!), the decimal separator is "," and not ".".
I have a couple of applications that don't recognize correctly the "." on the numeric pad and don't let me use it for decimals.
At the meantime, obviously, I don't want to remap the "." to "," for -all- apps!!!
So what I would need is a keyboard remapper able to understand "what application is on focus" before chenging the keyboard value...

...is there something around there (or can be easily made) which can do this???

thnks in advance.
bye
ugo


« Last Edit: March 03, 2006, 08:41 AM by brotherS »

wr975

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 369
    • Coding Snacks
Re: IDEA: Remap keyboard press value for -one- application
« Reply #1 on: March 03, 2006, 09:00 AM »
A simple AutoHotkey Script could do it for you.

In this example applications "Slimbrowser" and "Whatever" will get a comma if you press NumpadDot. All other applications still get a dot.

Just adapt this example, or wait if someone codes something better... ;-)

Code
NumpadDot::
IfWinActive, ahk_class SlimBrowser MainFrame
{
     send,,
     return
}

IfWinActive, whatever
{
     send,,
     return
}

send,.
return

Used commands for reference:

http://www.autohotkey.com/docs/Hotkeys.htm
http://www.autohotkey.com/docs/commands/IfWinActive.htm
http://www.autohotkey.com/docs/commands/Send.htm
http://www.autohotkey.com/docs/commands/Return.htm

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
Re: IDEA: Remap keyboard press value for -one- application
« Reply #2 on: March 03, 2006, 09:07 AM »
I'm using this code to remap the standard "," that I have in my keyboard layout to "." on demand! Very helpful:

Code
;2005-11-24
;remap Ctrl-NumpadDot to produce .
#Persistent
^NumpadDot::
Send .
return
Thank you.

ugo

  • Participant
  • Joined in 2005
  • *
  • Posts: 3
Re: IDEA: Remap keyboard press value for -one- application
« Reply #3 on: March 03, 2006, 09:58 AM »

>A simple AutoHotkey Script could do it for you

Wonderful!!!
Great idea.

The only trouble with your script is that it seems to gain a loop:
the last "send ,." causes the script being executed again...
what else can I do insted?

thnx again

bye
ugo

ugo

  • Participant
  • Joined in 2005
  • *
  • Posts: 3
Re: IDEA: Remap keyboard press value for -one- application
« Reply #4 on: March 03, 2006, 10:57 AM »
Found!!!!

I must test WinActive first and the key second!!!!

#IfWinActive MyWindow
NumpadDot::
send,,
return

thnks again everyone.

Original address: https://www.donationcoder.com/forum/index.php?topic=2627.0