Author Topic: autohotkey problems (an ongoing thread with older problems bumped down the OP)  (Read 1563 times)

0 Members and 1 Guest are viewing this topic.

Offline berserkfan

  • Thread Starter
  • Posts: 2135
  • Location: Not CONUS Not CONUS Not CONUS Not CONUS
  • changing diapers is more fun than model f assembly
New problem with my autohotkey
(The older problem, which has been solved, has been bumped down the OP)

I am trying to do 2 things on the same autohotkeyscript.
1)   rearrange the alphas to my custom layout
2)   put in some key combos tied to my custom layout

For instance, I want to turn the original B (scancode 030) to K.
The original N to B
The original J to N
And then put in macros such that when I press windows-b, I get the BBC. When I press windows-n, I get the New York Times.

Here’s some sample script that doesn’t work. I can get the New York Times, but not the BBC. The funny thing is, the exact same script worked when I was still using standard layout ie did no try rearranging the alphas. But once I added in the code rearranging the alphas, I got problems.

j::n
sc030::k
n::b
#n::
Run http://www.nytimes.com/
return

#b::
Run http://www.bbc.co.uk/news/
return


Just for reference, the entire block of code added is this. It's my custom modified colemak layout.

w::g
e::f
r::  p (space added to avoid an auto smiley forming)
t::w
y::del
u::l
i::u
o::j
sc019::y
[::;
]::backspace
capslock::backspace
a::r
s::a
d::s
f::t
g::d
j::n
k::e
l::i
sc027::  o (space added to avoid an auto smiley forming)
c::v
v::c
sc030::k
n::b



OP below kept for archive purposes

I haven’t posted about this for a while because I’d gotten most of my ahk problems under control. But now I have to ask… any input would be deeply appreciated!

I want to use the numpad3 as a ‘multi pagedown’ instead of single page down and numpad9 as a multi page up.

I created this code
NumpadPgUp::
Loop, 4
{
Send 4{PgUp}
}
Return

NumpadPgDn::
Loop, 4
{
Send 4{PgDn}
}
Return

This code works fine when in a pdf document or google chrome. Unfortunately, when trying to page up and down quickly in a word document, pressing num3 will lead to the number 4 being inserted 4 times, once on each page down. Ditto for num9, which inserts 4 for each page up.

Does anyone have a suggestion on how I can solve this?
« Last Edit: Tue, 05 May 2015, 20:32:11 by berserkfan »
Most of the modding can be done on your own once you break through the psychological barriers.

Offline trizkut

  • * Global Moderator
  • Posts: 1207
  • Location: MA
Re: autohotkey problem
« Reply #1 on: Tue, 05 May 2015, 10:38:21 »
Is there a reason why you have 4 before {PgUp} and {PgDown}?  I'd guess that's why you're inserting 4s


Offline berserkfan

  • Thread Starter
  • Posts: 2135
  • Location: Not CONUS Not CONUS Not CONUS Not CONUS
  • changing diapers is more fun than model f assembly
Re: autohotkey problem
« Reply #2 on: Tue, 05 May 2015, 10:42:42 »
Is there a reason why you have 4 before {PgUp} and {PgDown}?  I'd guess that's why you're inserting 4s

I want to do 4 page ups or downs at the same time. That helps me move more quickly through a long document, since I can already do one page up/down with the regular page up/down key.
Most of the modding can be done on your own once you break through the psychological barriers.

Offline trizkut

  • * Global Moderator
  • Posts: 1207
  • Location: MA
Re: autohotkey problem
« Reply #3 on: Tue, 05 May 2015, 10:43:08 »
Is there a reason why you have 4 before {PgUp} and {PgDown}?  I'd guess that's why you're inserting 4s

I want to do 4 page ups or downs at the same time. That helps me move more quickly through a long document, since I can already do one page up/down with the regular page up/down key.

Isn't that what the loop is for?


Offline greath

  • Posts: 231
  • Location: Maryland
  • A waffle is like a pancake with a syrup trap.
Re: autohotkey problem
« Reply #4 on: Tue, 05 May 2015, 10:44:29 »
Is there a reason why you have 4 before {PgUp} and {PgDown}?  I'd guess that's why you're inserting 4s

I don't understand why they are their either, but I would *imagine* it would send 4 4's if that were the issue.

Maybe you need to add a quarter-second or so wait time?

Offline trizkut

  • * Global Moderator
  • Posts: 1207
  • Location: MA
Re: autohotkey problem
« Reply #5 on: Tue, 05 May 2015, 10:55:15 »
Is there a reason why you have 4 before {PgUp} and {PgDown}?  I'd guess that's why you're inserting 4s

I don't understand why they are their either, but I would *imagine* it would send 4 4's if that were the issue.

Maybe you need to add a quarter-second or so wait time?

He said it did, once for every PageUp/PageDown.  It doesn't affect pdfs/chrome because you aren't editing in those instances.


Offline greath

  • Posts: 231
  • Location: Maryland
  • A waffle is like a pancake with a syrup trap.
Re: autohotkey problem
« Reply #6 on: Tue, 05 May 2015, 11:09:26 »
Is there a reason why you have 4 before {PgUp} and {PgDown}?  I'd guess that's why you're inserting 4s

I don't understand why they are their either, but I would *imagine* it would send 4 4's if that were the issue.

Maybe you need to add a quarter-second or so wait time?

He said it did, once for every PageUp/PageDown.  It doesn't affect pdfs/chrome because you aren't editing in those instances.

My fault. I misread the original. I thought he was only getting the number 4 once on the word documents. That's what I Was saying was strange.

Offline berserkfan

  • Thread Starter
  • Posts: 2135
  • Location: Not CONUS Not CONUS Not CONUS Not CONUS
  • changing diapers is more fun than model f assembly
Re: autohotkey problem
« Reply #7 on: Tue, 05 May 2015, 11:42:18 »
OK, I corrected my code based on the feedback received.

NumpadPgUp::
Loop, 4
{
Send {PgUp}
}
Return

NumpadPgDn::
Loop, 4
{
Send {PgDn}
}
Return

works now. Thanks everyone!
Most of the modding can be done on your own once you break through the psychological barriers.