AutoHotkey Community

It is currently May 27th, 2012, 8:18 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: June 6th, 2009, 10:13 pm 
If I remap keys using below script to use CapsLock+i to move up etc. it works perfectly well in Wordpad, Outlook, Excel but NOT in OneNote.
Left and Right movement works in OneNote but not Up and Down (with CapLock+i and Capslock+k). I run it on Vista-64.

Is this a bug?

THANKS for any suggestions!

Code:
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

SetCapsLockState, AlwaysOff

CapsLock & i::
       if getkeystate("alt") = 0
               Send,{Up}
       else
               Send,+{Up}
return

CapsLock & l::
       if getkeystate("alt") = 0
               Send,{Right}
       else
               Send,+{Right}
return

CapsLock & j::
       if getkeystate("alt") = 0
               Send,{Left}
       else
               Send,+{Left}
return

CapsLock & k::
       if getkeystate("alt") = 0
               Send,{Down}
       else
               Send,+{Down}
return


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 16th, 2009, 10:42 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
In case you haven't found a solution, you could try using SendPlay, or set the script to have administrator access:

On Windows Vista, some scripts might require administrator privileges to function properly (such as a script that interacts with a process or window that is run as administrator). To achieve this, add the following at the top of the script (this would need to be enhanced to work for compiled scripts and/or to pass parameters):
Code:
if not A_IsAdmin
{
   DllCall("shell32\ShellExecuteA", uint, 0, str, "RunAs", str, A_AhkPath
      , str, """" . A_ScriptFullPath . """", str, A_WorkingDir, int, 1)
   ExitApp
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 12th, 2009, 3:33 am 
Offline

Joined: October 12th, 2009, 3:25 am
Posts: 2
You have to use SendPlay {UP} for OneNote for some reason.
Since SendPlay is not compatible with UAE, you must disable UAE though.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 25th, 2009, 2:24 am 
Offline

Joined: October 25th, 2009, 2:22 am
Posts: 1
Location: Wilmington, DE
This is a really annoying bug - especially for people like me, who don't have admin access at work. Who should I bug to please get this fixed?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 9th, 2009, 8:36 am 
Offline

Joined: October 12th, 2009, 3:25 am
Posts: 2
http://blogs.msdn.com/winsdk/archive/20 ... ror-5.aspx

The instruction on this page works.

You need an administrator priviledge anyway.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Windows 7
PostPosted: January 25th, 2012, 12:17 am 
I was struggling with the same problem for quite some time.
On Windows 7, SendPlay seems to work with OneNote.

That's the script I use:

Code:
SetCapsLockState, AlwaysOff

;###########################################
; Use Capslock for Navigation
; Drawback: Couldn't get the CapsLock+Shift+Key combo to work
;###########################################

;Does not work in OneNote
;Capslock & k::Send {Down}
;Capslock & i::Send {Up}


Capslock & j::SendPlay {Left}
Capslock & l::SendPlay {Right}
Capslock & k::SendPlay {Down}
Capslock & i::SendPlay {Up}


Capslock & u::SendPlay {Home}
Capslock & o::SendPlay {End}

Capslock & h::SendPlay {PgUp}
Capslock & n::SendPlay {PgDn}


Capslock & x::SendPlay {Del}
Capslock & z::SendPlay ^{z}
Capslock & y::SendPlay ^{y}
Capslock & c::SendPlay ^{c}
Capslock & v::SendPlay ^{v}
Capslock & s::SendPlay ^{s}
Capslock & a::SendPlay ^{a}
Capslock & w::SendPlay ^{w}
Capslock & e::SendPlay ^{e}
Capslock & q::SendPlay ^{q}

Capslock & Tab::SendPlay ^{Tab}

Capslock & NumpadSub::SendPlay {Volume_Down}
Capslock & NumpadAdd::SendPlay {Volume_Up}
Capslock & NumpadMult::SendPlay {Volume_Mute}



;########################################
; Use Control for Navigation
; Drawback 1: Overwrites Control+CursorKeys combo for word skipping
; Drawback 1: Ctrl+n is used for new folders etc.
;#########################################

^j::SendPlay ^{Left}
^k::SendPlay ^{Down}
^l::SendPlay ^{Right}
^i::SendPlay ^{Up}

^u::SendPlay {Home}
^o::SendPlay {End}

+^j::SendPlay +{Left}
+^k::SendPlay +{Down}
+^l::SendPlay +{Right}
+^i::SendPlay +{Up}

+^u::SendPlay +{Home}
+^o::SendPlay +{End}


As a follow-up:
If anybody could tell me how I can get a CapsLock+Shift+Key combo to work, I would highly appreciate it.


Report this post
Top
  
Reply with quote  
 Post subject: Re: Windows 7
PostPosted: January 25th, 2012, 12:45 am 
Offline
User avatar

Joined: December 20th, 2004, 12:19 pm
Posts: 798
Location: LooseChange911.com Ask Questions, Demand Answers █ The WTC bldgs █ shouldn't have fallen █ that fast
adastra wrote:
If anybody could tell me how I can get a CapsLock+Shift+Key combo to work, I would highly appreciate it.

...I think the only way to do it is to detect the Shift inside a Capslock & <key> hotkey...

Code:
Capslock & j::
shift:=GetKeyState("Shift") ? "Shift+":""
i++
Tooltip, %i% Capslock+%shift%J
return

_________________
AutoHotkey-Hotstring.ahk - Helping the world spell "AutoHotkey" correctly! (btw, it's a lowercase k!)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group