Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

qwerty to Dvorak, while keeping several alt/ctrl/windows..


  • Please log in to reply
19 replies to this topic
Recusant
  • Members
  • 11 posts
  • Last active: Feb 11 2012 04:08 AM
  • Joined: 12 Jun 2011
Hi, i'm really new and not able to program a VCR!

At work, i can't change my keyboard unless i use an .exe - which works a treat. My problem is i don't know what i'm doing.

Here is my script (which doesn't work properly). It remaps the keys fine - but it won't let me keep my qwerty cut/copy/paste etc.

-::[ 
=::] 

q::' 
w::, 
e::. 
r::p 
t::y 
y::f 
u::g 
i::c 
o::r 
p::l 
[::/ 
]::= 
;\::\ ;no change 

;a::a ;no change 
s::o 
d::e 
f::u 
g::i 
h::d 
j::h 
k::t 
l::n 
SC027::s 
SC028::- 

z::SC027 
x::q 
c::j 
v::k 
b::x 
n::b 
m::m 
,::w 
.::v 
/::z 

; For Cut/Copy/Paste (QJK keys to XCV) etc...
^q::^x ;cut
^j::^c ;copy
^k::^v ;paste
^y::^t ;New Tab
^,::^w ;Close Tab

; To remap some other Windows key shortcuts:
#.::#e ;Windows Explorer
#p::#r ;Run Dialogue
#n::#l ;Lock Computer

I got some insights from arkenflame's post (copied his basics): <!-- m -->http://www.autohotke...pic.php?t=27474<!-- m -->

I don't understand more than the basic remapping. :(

Obviously the ^/# stuff won't work the way i've done it. I want a script i can understand how to add/remove the combination keystrokes and eventually be able to set my own 'toggle' key, which is why i don't just use arkenflame's script.

Thanks in advance.

SoLong&Thx4AllTheFish
  • Members
  • 4999 posts
  • Last active:
  • Joined: 27 May 2007
Try this
; For Cut/Copy/Paste (QJK keys to XCV) etc...

$^q::Send +{Del} ;cut

$^j::Send ^{Ins} ;copy

$^k::Send +{Ins} ;paste

$^y::Send ^t ;New Tab

$^,::Send ^w ;Close Tab


Recusant
  • Members
  • 11 posts
  • Last active: Feb 11 2012 04:08 AM
  • Joined: 12 Jun 2011
Hi Hugov, thanks for replying. Unfortunately it didn't work :(

SoLong&Thx4AllTheFish
  • Members
  • 4999 posts
  • Last active:
  • Joined: 27 May 2007
That's weird because it does for me. What doesn't work?

Recusant
  • Members
  • 11 posts
  • Last active: Feb 11 2012 04:08 AM
  • Joined: 12 Jun 2011
When i try to use the shortcuts, it does nothing (except beep) with one exception: ctrl+c deletes the highlighted text and inserts a carriage return (!?) - bizarre.

I tested in notepad, and i'm using Windows7x64 (freshly rebuilt too).

Are you using the shortcuts mappings with the rest of the key mappings? Or in isolation (using the OS to set Dvorak)?

SoLong&Thx4AllTheFish
  • Members
  • 4999 posts
  • Last active:
  • Joined: 27 May 2007
Regular qwerty layout, run the full script e.g. all remapped keys.
^ins etc are standard windows shortcut alternatives for copy/cut/paste so it shouldn't beep.

Recusant
  • Members
  • 11 posts
  • Last active: Feb 11 2012 04:08 AM
  • Joined: 12 Jun 2011
hmmm... i've the same set up.

Mind posting your whole script? (just maybe i've got something invalid in my script. This is extremely odd.

SoLong&Thx4AllTheFish
  • Members
  • 4999 posts
  • Last active:
  • Joined: 27 May 2007
It is your script with the lines I posted replacing yours so I won't post the full code. Try another computer. Did you save the script as utf-8 (shouldn't matter I think in this case, but you never know)

Recusant
  • Members
  • 11 posts
  • Last active: Feb 11 2012 04:08 AM
  • Joined: 12 Jun 2011
I'm on another PC now, it does the same thing for me (i compiled it before coming over so i don't have the script with me.

I will look at the file format when i get home - i didn't 'choose' utf-8 - so maybe it isn't.

Thanks for helping me troubleshoot this.

SoLong&Thx4AllTheFish
  • Members
  • 4999 posts
  • Last active:
  • Joined: 27 May 2007
Note that there is no need to compile in order to run a script.
If you want it portable there are various scripts that will help you manage scripts, OR take advantage of the standard AutoHotkey behaviour:

Place AutoHotkey.exe and your script in the same folder, if you name your script AutoHotkey.ahk or AutoHotkey.ini it will launch that script.

Or rename AutoHotkey.exe to nameofscript.exe, so say your scripts name is MyDvorakStyle.ahk if you name AutoHotkey.exe MyDvorakStyle.exe and place both in the same folder you can simply run the exe.

Or you can run AutoHotkey via the cmdline, batch
PathToAutoHotkey.exe PathToMyDvorakStyle.ahk

Recusant
  • Members
  • 11 posts
  • Last active: Feb 11 2012 04:08 AM
  • Joined: 12 Jun 2011
Nice tips :)

I saved as UTF-8 (it wasn't before, i suspect) but it made no difference. What on earth am i doing wrong? :(

Might it be something to do with the OS input langage? I can't see how, but i'm clutching at staws here. Both the PCs i've tested on are: "English (Australia) - US".

SoLong&Thx4AllTheFish
  • Members
  • 4999 posts
  • Last active:
  • Joined: 27 May 2007
Ah well, that explains it. Hold the script upside down and it might work :D

No idea why it doesn't work, how about just trying the cut/copy/paste on its own. Are you sure there are no other scripts running, or other programs that rely on hotstrings, hotkeys etc.?

Recusant
  • Members
  • 11 posts
  • Last active: Feb 11 2012 04:08 AM
  • Joined: 12 Jun 2011
lol (cry).

Nothing is running that i can see that fiddles with keys.

In the past (and at home i can, but not at work) i set the Dvorak as the OS keyboard and used the:
^q::^x ;cut 
^j::^c ;copy 
^k::^v ;paste 
^y::^t ;New Tab 
^,::^w ;Close Tab 

That worked. I haven't done so in a while though as it's no good for work (the policy or something keeps changing my keyboard back to QWERTY).

Maybe i just have to use Arkenflame's script. :(

SoLong&Thx4AllTheFish
  • Members
  • 4999 posts
  • Last active:
  • Joined: 27 May 2007
Really try it on another computer (not at work) and it should work, therefore the problem is something (program, setting) on your office PC that is something hard to debug. You could create a script to quickly change the keyboard layout in the OS from qwerty to dvorak?

Recusant
  • Members
  • 11 posts
  • Last active: Feb 11 2012 04:08 AM
  • Joined: 12 Jun 2011
I've tried it on 3 PCs: my home, my friend's home and at work with the same results. :(

I went through arkenflames post again and found a contribution from "Igor". I'm trying his script now and it works (but is not selective - it's all or nothing)

; Use Scroll Lock to control keyboard ("on" is Dvorak)
; and do not let Control, Alt, or Win modifiers act on Dvorak
Loop {
   If GetKeyState("ScrollLock", "T")
   and !GetKeyState("Control")
   and !GetKeyState("Alt")
   and !GetKeyState("LWin")
   and !GetKeyState("RWin") {
      Suspend, Off
   } else {
      Suspend, On
   }
   Sleep, 50
}

; QWERTY to Dvorak mapping
-::[
=::]

q::'
w::,
e::.
r::p
t::y
y::f
u::g
i::c
o::r
p::l
[::/
]::=

;a::a
s::o
d::e
f::u
g::i
h::d
j::h
k::t
l::n
`;::s
'::-

z::`;
x::q
c::j
v::k
b::x
n::b
;m::m
,::w
.::v
/::z

I'm thinking i can live with this, simpler, script (compared to arkenflames). However, can i change the toggle key to something else? That one seems to be an 'on/off' switch - what happens if i need to use scroll lock for something 'legitimate'? Though i don't recall exactly when i last used it - i know i have very occassionally in the past.