Author Topic: .  (Read 1462 times)

0 Members and 1 Guest are viewing this topic.

Offline esoomenona

  • Gnillort?
  • Thread Starter
  • Posts: 5323
.
« on: Tue, 04 March 2014, 14:03:17 »
.
« Last Edit: Tue, 25 August 2015, 10:17:33 by esoomenona »

Offline N1ne

  • Posts: 6
  • Location: Edinburgh
  • Nub
Re: AHK Possibility? Any help would be appreciated
« Reply #1 on: Tue, 04 March 2014, 20:45:06 »
I wrote a small application in AutoIt (don't know ahk) to try and help you out.

Basically what it does is send alt down and up as if the numpad dot key was the alt key but it also checks when you release numpad dot if it was held for less than 150 ms (basically a tap) it will send the numpad dot character.

Limitations are you can't hold the dot button to type many dots in a row, other than that it's pretty good.

It may have difficulty with extremely fast usage of alt as a modifier (if you can hit alt as a modifier and the key that you would like to apply it to then release them in under 150ms it will apply alt to the keypress but it will also send the . character)

Code: [Select]
Local $hDLL = DllOpen("user32.dll")

HotKeySet("{NUMPADDOT}", "captureDot")

;Capture NUMPADDOT so the character is only sent when we want it to be.
Func captureDot()
EndFunc

While 1
If _IsPressed("6E", $hDLL) Then
;ConsoleWrite("_IsPressed - Numpad Dot was pressed." & @CRLF) ;debug line
;Simulate ALT down immediately.
Send("{ALT down}")
$presstime = TimerInit()

; Wait until key is released.
While _IsPressed("6E", $hDLL)
Sleep(10)
WEnd

; After key is released check how long it was held, if under 150ms send NUMPADDOT.
Send("{ALT up}")
If TimerDiff($presstime) < 150 Then
HotKeySet("{NUMPADDOT}")
Send("{NUMPADDOT}")
HotKeySet("{NUMPADDOT}", "captureDot")
EndIf

;ConsoleWrite("_IsPressed - Numpad Dot was released. " & TimerDiff($presstime) & @CRLF) ;debug line

;ExitLoop
EndIf
WEnd

Let me know if you need help getting it going, I can also compile it down to an exe if needed.
« Last Edit: Tue, 04 March 2014, 21:28:26 by N1ne »
Ahhh cripes Eva! Just sign it yourself will ya? I'm busy!

We do what we must because we can.

Offline angelic_sedition

  • Posts: 124
  • Location: Flatland
Re: AHK Possibility? Any help would be appreciated
« Reply #2 on: Wed, 05 March 2014, 01:27:22 »
Have you seen this thread: http://geekhack.org/index.php?topic=41685.0
and this: https://github.com/lydell/dual
?

I think this is the functionality you are looking for.
QWERTY(104wpm) -> CarpalxQ(modded) -> Colemak(118wpm) -> Colemak-DH
Mouse less.

Offline N1ne

  • Posts: 6
  • Location: Edinburgh
  • Nub
Re: AHK Possibility? Any help would be appreciated
« Reply #3 on: Wed, 05 March 2014, 01:43:22 »
Have you seen this thread: http://geekhack.org/index.php?topic=41685.0
and this: https://github.com/lydell/dual
?

I think this is the functionality you are looking for.

I should have known something so useful would have been created before!!

These are probably more feature rich implementations of the code above, hopefully it's still insightful for someone who wants to know how it works and it can pretty much be dropped in to any AutoIt project and modified to suit other keys.

Incidentally I can write any creative hotkey/key replacement/modifier edit you can think of within the bounds of current computer capabilities so if anyone else wants something bespoke just shoot me a message.
« Last Edit: Wed, 05 March 2014, 03:41:25 by N1ne »
Ahhh cripes Eva! Just sign it yourself will ya? I'm busy!

We do what we must because we can.