Jump to content

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

Two keys to one key



  • Please log in to reply
29 replies to this topic
mrcgnerd
  • Members
  • 17 posts
  • Last active: Feb 24 2014 10:34 PM
  • Joined: 13 Aug 2013

Hello, i am trying to do this:

 

LShift+LAlt = Ctrl (Then i press Shift+Alt combination i want it to act like Ctrl).

 

I tried:

 

^!::Ctrl but it's not working. 

 

i thought  it will be simple, but i cant get it.

 

Sory for my bad english, PLEASE HELP.



LazyMan
  • Members
  • 587 posts
  • Last active: Oct 21 2014 05:13 PM
  • Joined: 17 Feb 2011
LShift & LAlt:: Send {Ctrl Down}
LShift & LAlt Up:: Send {Ctrl Up}


mrcgnerd
  • Members
  • 17 posts
  • Last active: Feb 24 2014 10:34 PM
  • Joined: 13 Aug 2013

Hi Thanks

 

But it's not working :(

 

LShift & LAlt:: Send {a Down}                                                   LShift & LAlt:: Send {Ctrl Down}
LShift & LAlt Up:: Send {a Up}       Works OK             But         LShift & LAlt Up:: Send {Ctrl Up}       Not working. 

 

I don't know why with 'a' key and other letter keys ewerything works fine, but with Ctrl not. 



LazyMan
  • Members
  • 587 posts
  • Last active: Oct 21 2014 05:13 PM
  • Joined: 17 Feb 2011

With what application are you trying to use the remapped keys?



mrcgnerd
  • Members
  • 17 posts
  • Last active: Feb 24 2014 10:34 PM
  • Joined: 13 Aug 2013

3ds max, Windows 8.1. But it seems like it's not working at all with Ctrl, for exsample I can't press ( LShift+LAlt ) + RAlt +Del nothing heppens.



mrcgnerd
  • Members
  • 17 posts
  • Last active: Feb 24 2014 10:34 PM
  • Joined: 13 Aug 2013

Ok i found that runing the script as administrator fixes the problem. But one more question :

Now i should press keys in order, first LShift then LAlt. How can i make this work in other direction too, or then the keys are pressed at the same time ?

 

Thank you.



LazyMan
  • Members
  • 587 posts
  • Last active: Oct 21 2014 05:13 PM
  • Joined: 17 Feb 2011
How can i make this work in other direction too, or then the keys are pressed at the same time ?
I would try define the opposite order, too, in order to enable the sequence to work both ways.  But the alternate order did not work for me in emacs, even though the first way does.  It does work for other keys, though, for example:
a & b::
b & a::
   Send c
Return

Your mileage may vary.



Ohnitiel
  • Members
  • 755 posts
  • Last active: Sep 08 2016 06:26 PM
  • Joined: 25 Aug 2011

<+LAlt::Send {Ctrl}
 
; OR
 
<!LShift::Send {Ctrl}

Let us not be lazy. Someday it might just kill us.

LazyMan
  • Members
  • 587 posts
  • Last active: Oct 21 2014 05:13 PM
  • Joined: 17 Feb 2011
<+LAlt::Send {Ctrl}
 
; OR
 
<!LShift::Send {Ctrl}

Neither of those works for me in emacs. :/

But I like your signature. :p



Ohnitiel
  • Members
  • 755 posts
  • Last active: Sep 08 2016 06:26 PM
  • Joined: 25 Aug 2011

Neither of those works for me in emacs. :/

But I like your signature. :p

 

I made the test using just a MsgBox, and it worked.

The signature is a reminder fo me to not be lazy aswell.  ;)


Let us not be lazy. Someday it might just kill us.

mrcgnerd
  • Members
  • 17 posts
  • Last active: Feb 24 2014 10:34 PM
  • Joined: 13 Aug 2013

Thank you but it still work just in one direction Shift + Alt but not Alt + Shift.
It's something wrong with Ctrl key, if i replace it with something else it works fine, for example:

<+LAlt::Send {F12}
; OR
<!LShift::Send {F12}

 
Is it possible to do something like this:
 

Set F12 :: Ctrl;
 
if (LAlt & LShift) OR (LShift & LAlt) DOWN
{
Send {F12 Down}
}
Return


Robb3rt
  • Members
  • 13 posts
  • Last active: Apr 01 2015 09:38 PM
  • Joined: 26 Jun 2013

Something like this?

Hotkey, LAlt, CtrlDown, On
Hotkey, LShift, CtrlDown, On
return

gks(kY){
	return % sT := getKeyState(kY, "P")
}

CtrlDown:
	while gks(A_ThisHotkey)
		if gks(A_ThisHotkey = "LShift" ? "LAlt" : "LShift")
			Send {F12 Down}
	Send {F12 Up}	
return


mrcgnerd
  • Members
  • 17 posts
  • Last active: Feb 24 2014 10:34 PM
  • Joined: 13 Aug 2013

Ok i found another problem then i press Shift + Alt then it acts like Ctrl, just as i want it, but it still reacts to Shift key i tried this:

LShift & LAlt:: Send {Shift Up}{Ctrl Down}
LShift & LAlt Up:: Send {Shift Up}{Ctrl Up}

But no luck :(



LazyMan
  • Members
  • 587 posts
  • Last active: Oct 21 2014 05:13 PM
  • Joined: 17 Feb 2011

I made the test using just a MsgBox, and it worked.

How can those key mappings be tested using just a MsgBox?  I don't understand. :S



mrcgnerd
  • Members
  • 17 posts
  • Last active: Feb 24 2014 10:34 PM
  • Joined: 13 Aug 2013

 

Something like this?

Hotkey, LAlt, CtrlDown, On
Hotkey, LShift, CtrlDown, On
return

gks(kY){
	return % sT := getKeyState(kY, "P")
}

CtrlDown:
	while gks(A_ThisHotkey)
		if gks(A_ThisHotkey = "LShift" ? "LAlt" : "LShift")
			Send {F12 Down}
	Send {F12 Up}	
return

 

 Yes, but instead F12 it should be Ctrl. I replaced F12 to Ctrl and it works, but i lost LAlt, and Shift fuctionality, then the single key is beeng pressed.

It's because this :

Hotkey, LAlt, CtrlDown, On
Hotkey, LShift, CtrlDown, On

And now it works when pressed Alt+Shift ok, BUT when Shift+Alt it works but, not realy well, hard to expplain it feels like lag. 

And this problem still exsist:

Ok i found another problem then i press Shift + Alt then it acts like Ctrl, just as i want it, but it still reacts to Shift key i tried this:
LShift & LAlt:: Send {Shift Up}{Ctrl Down}
LShift & LAlt Up:: Send {Shift Up}{Ctrl Up}
But no luck 

I tried to solve this, but now script works just one time and stops:

Hotkey, LAlt, CtrlDown, On
Hotkey, LShift, CtrlDown, On
return

gks(kY){
    return % sT := getKeyState(kY, "P")
}

CtrlDown:
    while gks(A_ThisHotkey)
        if gks(A_ThisHotkey = "LShift" ? "LAlt" : "LShift")
            Send {Ctrl Down}
    Send {Ctrl Up} 
    Hotkey, LAlt, CtrlDown, Off
    Hotkey, LShift, CtrlDown, Off   
return