Help with the transposing script please.

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Artisk
Posts: 2
Joined: 07 Dec 2022, 20:19

Help with the transposing script please.

Post by Artisk » 07 Dec 2022, 20:23

So basically what i need, is to transpose "1!2@34$5%6^78*9(0qQwWeErtTyYuiIoOpPasSdDfgGhHjJklLzZxcCvVbBnm" on a keyboard by +1 or -1, so basically if it's +1, instead of pressing Q i would get w or instead of pressing a i would get s, but if it's -1, i would get q instead of Q and etc. I'm really sorry for such poor explanation, but basically it would work like transposition on musical instruments, ty in advance

Artisk
Posts: 2
Joined: 07 Dec 2022, 20:19

Re: Help with the transposing script please.

Post by Artisk » 07 Dec 2022, 21:09

[/Codebox]

Code: Select all

q::w
w::e
e::r
r::t
t::y
y::u
u::i
i::o
o::p
p::a
a::s
s::d
d::f
f::g
g::h
h::j
j::k
k::l
l::z
z::x
x::c
c::v
b::n
n::m
1::2
2::3
3::4
4::5
5::6
6::7
7::8
8::9
so this is the code to transpose keys by +1, how do i simplify the code and make it controllable by arrow keys?

User avatar
zvit
Posts: 224
Joined: 07 Nov 2017, 06:15

Re: Help with the transposing script please.

Post by zvit » 07 Dec 2022, 21:45

Sorry, wrong forum :-) I don't know how to delete a post.
Last edited by zvit on 07 Dec 2022, 22:16, edited 1 time in total.

User avatar
mikeyww
Posts: 26877
Joined: 09 Sep 2014, 18:38

Re: Help with the transposing script please.

Post by mikeyww » 07 Dec 2022, 21:49

Gee, I dunno. This is the AutoHotkey forum, right?

Here is mine.

Code: Select all

#SingleInstance Force
txp := "1!2@34$5%6^78*9(0qQwWeErtTyYuiIoOpPasSdDfgGhHjJklLzZxcCvVbBnm"
len := StrLen(txp)
its  =  1
; its  = -1
Loop {
 Input, key, L1
 pos1 := Instr(txp, key, True), pos2 := pos1 + its
 If pos2 between 1 and %len%
      SendInput % "{Text}" (pos1 ? SubStr(txp, pos2, 1) : key)
 Else SendInput % "{Text}" key
}

Post Reply

Return to “Ask for Help (v1)”