AutoHotkey Community

It is currently May 26th, 2012, 10:34 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 15 posts ] 
Author Message
PostPosted: September 9th, 2009, 2:44 pm 
Offline

Joined: March 18th, 2008, 12:31 am
Posts: 63
Location: Barcelona, Catalonia
I am using the key "k" with other keys to trigger a hotkey, the problem is that then I can't type a "K".

Here's a sample of that code:

Code:
k::Send {k} ; right now I can't type K

k & u::Send {Blind}{Up}
k & h::Send {Blind}{Left}
k & n::Send {Blind}{Down}
k & j::Send {Blind}{Right}

k & e::Send {PgUp}
k & c::Send {PgDn}

k & a::Send {Home}
k & l::Send {End}


I use Blind on some hotkeys so I can use shift+k+h to select text.

anyway, I have tried with * and ~ as explained here and I can't figure out how to use the script and still type a capital k.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 9th, 2009, 2:59 pm 
Offline

Joined: May 17th, 2007, 12:07 pm
Posts: 1004
Location: Germany - Deutschland
Perhaps you send down the shift-key anywhere in your script und dont release it again...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 9th, 2009, 3:26 pm 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8666
Location: Salem, MA
please try

Code:
~k & u::Send {Blind}{Up}
~k & h::Send {Blind}{Left}
~k & n::Send {Blind}{Down}
~k & j::Send {Blind}{Right}

~k & e::Send {PgUp}
~k & c::Send {PgDn}

~k & a::Send {Home}
~k & l::Send {End}

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 9th, 2009, 8:39 pm 
Offline

Joined: March 18th, 2008, 12:31 am
Posts: 63
Location: Barcelona, Catalonia
aaffe, sorry, I didn't understand you.


engunneer, your suggestion works, but now I have another problem: with this new script when I press 'k' and then 'u' to move the cursor, a 'k' gets typed and then it moves the cursor.


I'll be checking this topic in case anyone has another solution :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 9th, 2009, 8:49 pm 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8666
Location: Salem, MA
Code:
k Up::Send {k} ; right now I can't type K

k & u::Send {Blind}{Up}
k & h::Send {Blind}{Left}
k & n::Send {Blind}{Down}
k & j::Send {Blind}{Right}

k & e::Send {PgUp}
k & c::Send {PgDn}

k & a::Send {Home}
k & l::Send {End}

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 9th, 2009, 9:12 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
I think you will have to explicitly list every modifier you wish to use with k.
Code:
 k::Send k
+k::Send K

k & u::Send {Blind}{Up}
k & h::Send {Blind}{Left}
k & n::Send {Blind}{Down}
k & j::Send {Blind}{Right}

k & e::Send {PgUp}
k & c::Send {PgDn}

k & a::Send {Home}
k & l::Send {End}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 9th, 2009, 10:52 pm 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8666
Location: Salem, MA
or easier:
Code:
*k Up::Send {k} ; right now I can't type K

k & u::Send {Blind}{Up}
k & h::Send {Blind}{Left}
k & n::Send {Blind}{Down}
k & j::Send {Blind}{Right}

k & e::Send {PgUp}
k & c::Send {PgDn}

k & a::Send {Home}
k & l::Send {End}

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
PostPosted: September 9th, 2009, 10:56 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
@engunneer
Are you testing these examples before you post them? Neither of your last two work for me on XP.

mai9 wrote:
I have tried with * and ~ as explained here and I can't figure out how to use the script and still type a capital k.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 9th, 2009, 11:02 pm 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8666
Location: Salem, MA
@jaco:
"My Sig wrote:
Unless noted, all code is UNTESTED.


Since they didn't show the variations of the ~ and * modifiers they tried, I suggested the ~ on each, and it seemed to be closer to their goal.

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 9th, 2009, 11:15 pm 
Offline

Joined: March 18th, 2008, 12:31 am
Posts: 63
Location: Barcelona, Catalonia
jaco0646, I think engunneer's first example (k Up::Send {k}" was just to explain what aaffe suggested. But his second suggestion didn't work in my winxp neither.

anyway, somehow I did test this suggestion and It didn't work, but now it does. Great :)

jaco0646 wrote:
I think you will have to explicitly list every modifier you wish to use with k.
Code:
 k::Send k
+k::Send K


Thanks you both :mrgreen:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 9th, 2009, 11:23 pm 
Offline

Joined: August 14th, 2009, 2:40 pm
Posts: 237
Location: Finland
not tested, but you could probably use *k in place of k, +k, !k, etc.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 9th, 2009, 11:28 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
:roll:

@mai9
I apologize that you keep getting abused with untested code. I think everyone here has AHK installed and should easily be able to discover whether their ideas work or not.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 9th, 2009, 11:43 pm 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3330
Location: Simi Valley, CA
Code:
*k::
Gui, 97:+Toolwindow
Gui, 97:Show, x-1 y-1 w1 h1 +NoActivate, Remaps when K is down
keywait, k
Gui, 97:Show, +NoActivate, K Remaps are off
If A_ThisHotkey = *k
   Send, {Blind}k
return

#IfWinExist, Remaps when K is down
u::Up
h::Left
n::Down
j::Right
e::PgUp
c::PgDn
a::Home
l::End
#IfWinExist,
*tested*

_________________
Ternary (a ? b : c) guide     TSV Table Manipulation Library
Post code inside [code][/code] tags!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 10th, 2009, 1:32 am 
Offline

Joined: August 14th, 2009, 2:40 pm
Posts: 237
Location: Finland
jaco0646 wrote:
I apologize that you keep getting abused with untested code. I think everyone here has AHK installed and should easily be able to discover whether their ideas work or not.


Yes, most of us do. Unfortunately due to time constraints, at least I am not able to always get to my windows machine, write the code, test it (perhaps extensively, depends on the code) and then report back. I'm, perhaps, more on my linux dev box and I do have kids. I think it's better to give pointers in the form of untested code than to keep quiet and not post anything until it is tested.

Just my 0.02€.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 10th, 2009, 3:29 am 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
AnttiV wrote:
I think it's better to give pointers in the form of untested code than to keep quiet and not post anything until it is tested.
I strongly disagree with this, and I may post a full-blown rant soon; :P but I’ll start a new topic, so as not to hijack this one even more.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Google [Bot], JSLover, Miguel, rbrtryn and 64 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