Jump to content

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

R Programming send <- -> %>% %<%


  • Please log in to reply
6 replies to this topic
davparker
  • Members
  • 7 posts
  • Last active: Sep 14 2014 04:30 AM
  • Joined: 12 Sep 2014

I'm trying to create my first, and what I thought, a simple script to input the following key combos from the base, magrittr and dplyr packages.

 

the assignment operators

<-   or   ->

and the piping operators

%>%  or  %>%

but near as I can tell, I can't get autokey to send any form of  <  or  >  as I think they are hotkeys. I can't seem to escape the keys either. I've spent hours so far. Please help.  Here is my script.  ~ thanks, david

 

 

#SingleInstance force    
#InstallKeybdHook
^!p::Pause  ; Press Ctrl+Alt+P to pause. Press it again to resume.
^Numpad4::
Send {<-}
return
^Numpad1::
Send {%<%}
return
^Numpad3::
Send {%>%}
return
^Numpad6::
Send {->}
return
 


Jackie Sztuk _Blackholyman
  • Spam Officer
  • 3757 posts
  • Last active: Apr 03 2016 08:47 PM
  • Joined: 28 Feb 2012
you need to remove the { } around your keys unless its only one key like {k} or {enter} but not when needing more keys aka this will not work {12} as there are no 12 key only 0-9... also when sending symbols like % you need to esc them like this `% or use sendraw
 
#SingleInstance force    
#InstallKeybdHook

^!p::Pause  ; Press Ctrl+Alt+P to pause. Press it again to resume.

^Numpad4::
SendRaw <-
return

^Numpad1::
SendRaw %<%
return

^Numpad3::
SendRaw %>%
return

^Numpad6::
SendRaw ->
return

Helping%20you%20learn%20autohotkey.jpg?d

[AHK] Version. 1.1+ [CLOUD] DropBox ; Copy [WEBSITE] Blog ; About

davparker
  • Members
  • 7 posts
  • Last active: Sep 14 2014 04:30 AM
  • Joined: 12 Sep 2014

Thanks. I tried running the script, but it generates an error on line 11.

SendRaw %<%

 

Man, If I can get the hang of this, it will save me all kinds of time. In R and elsewhere as I have no hands and type with a prosthesis.



davparker
  • Members
  • 7 posts
  • Last active: Sep 14 2014 04:30 AM
  • Joined: 12 Sep 2014

Thanks. I tried running the script, but it generates an error on line 11.

SendRaw %<%

 

Man, If I can get the hang of this, it will save me all kinds of time. In R and elsewhere as I have no hands and type with a prosthesis.

 

ok, bad ass. a little tweak...  I had to send each individually when sending %  and to escape it..  '%  even though I used SendRaw

Thanks a lot man!

 

#SingleInstance force    
#InstallKeybdHook
 
^!p::Pause  ; Press Ctrl+Alt+P to pause. Press it again to resume.
 
Numpad4::
SendRaw <-
return
 
Numpad6::
SendRaw ->
return
 
Numpad1::
;SendRaw %<%
SendRaw `%
SendRaw <
SendRaw `%
return
 
Numpad3::
;SendRaw %>%
SendRaw `%
SendRaw >
SendRaw `%
return


davparker
  • Members
  • 7 posts
  • Last active: Sep 14 2014 04:30 AM
  • Joined: 12 Sep 2014

OK,  so I only need this enabled when running for a couple of programs. Can it automatically detect that?

 

Thanks again!



Jackie Sztuk _Blackholyman
  • Spam Officer
  • 3757 posts
  • Last active: Apr 03 2016 08:47 PM
  • Joined: 28 Feb 2012
#IfWinActive, ahk_class Notepad
^Numpad6::
send `%
return
that hotkey will only work with notepad as the active window

#ifwinactive will be one way to do what you need
Helping%20you%20learn%20autohotkey.jpg?d

[AHK] Version. 1.1+ [CLOUD] DropBox ; Copy [WEBSITE] Blog ; About

davparker
  • Members
  • 7 posts
  • Last active: Sep 14 2014 04:30 AM
  • Joined: 12 Sep 2014

Awesome. Thank again.