Dear members of the community,
If anyone of you is familiar with "RStudio" at all (R, programming language IDE) -
Is it normal that the software disables all AutoHotkeys once open ?
Only concerns the window itself too, switching to anything else and my layout works just fine.
(some of my A-Hkeys even crash the program altogether, eg. language switching)
Anyhow,
I would greatly appreciate any insights you guys might have on the matter.
Cheerios -
RStudio refuses AutoHotkeys - (...why?)
Re: RStudio refuses AutoHotkeys - (...why?)
Sounds like a permissions issue - probably RStudio runs with elevated rights.
See https://www.autohotkey.com/docs/FAQ.htm#uac
The language switching problem might be completely unrelated.
See https://www.autohotkey.com/docs/FAQ.htm#uac
The language switching problem might be completely unrelated.
Re: RStudio refuses AutoHotkeys - (...why?)
or installs keyboard hooks on top of ahk's(and possibly removes them once the window is no longer active)
show the script
show the script
Re: RStudio refuses AutoHotkeys - (...why?)
Thanks for your fast reply -
What are keyboard "hooks" ?
Here's the script (sorry for the mess)
_________________________________________________________________________________________________
Code: Select all
#If GetKeyState("CapsLock", "T")
j::Numpad1
k::Numpad2
l::Numpad3
u::Numpad4
i::Numpad5
o::Numpad6
7::Numpad7
8::Numpad8
9::Numpad9
,::Numpad0
0::+
p::-
SC027::*
.::=
m::,
w::up
a::left
s::down
d::right
r::pgup
f::pgdn
q:: send {LWin down}{LCtrl down}{Left}{LCtrl up}{LWin up}
e:: send {LWin down}{LCtrl down}{Right}{LCtrl up}{LWin up}
SC056:: send {LCtrl down}{a down}{a up}{LCtrl up}
x:: send {LCtrl down}{x down}{x up}{LCtrl up}
c:: send {LCtrl down}{c down}{c up}{LCtrl up}
v:: send {LCtrl down}{v down}{v up}{LCtrl up}
z:: send {LCtrl down}{z down}{z up}{LCtrl up}
y:: send {LCtrl down}{y down}{y up}{LCtrl up}
SC029:: SetDefaultKeyboardLang(0x0407) ; german
1:: SetDefaultKeyboardLang(0x02809) ; english
2:: SetDefaultKeyboardLang(0x040C) ; french
3:: SetDefaultKeyboardLang(0x0804) ; chinese
SetDefaultKeyboardLang(LocaleID){
Static SPI_SETDEFAULTINPUTLANG := 0x005A, SPIF_SENDWININICHANGE := 2
Lan := DllCall("LoadKeyboardLayout", "Str", Format("{:08x}", LocaleID), "Int", 0)
VarSetCapacity(binaryLocaleID, 4, 0)
NumPut(LocaleID, binaryLocaleID)
DllCall("SystemParametersInfo", "UInt", SPI_SETDEFAULTINPUTLANG, "UInt", 0, "UPtr", &binaryLocaleID, "UInt", SPIF_SENDWININICHANGE)
WinGet, windows, List
Loop % windows {
PostMessage 0x50, 0, % Lan, , % "ahk_id " windows%A_Index%
}
}
;#If GetKeyState("CapsLock", "T")
;x::
;c::
;v::
;Send ^%A_ThisHotkey%
;SetCapsLockState, Off
;Return
;\::
;Send ^a
;SetCapsLockState, Off
;Return
_______________________________________________________________________________________________________-
Re: RStudio refuses AutoHotkeys - (...why?)
Hey, thank you for your reply -gregster wrote: ↑28 Jul 2021, 07:35Sounds like a permissions issue - probably RStudio runs with elevated rights.
See https://www.autohotkey.com/docs/FAQ.htm#uac
The language switching problem might be completely unrelated.
Hm, well RStudio does run with administrator rights on in order to function properly.
Is there a way to sidestep this permissions issue ?
Re: RStudio refuses AutoHotkeys - (...why?)
if ure interested in the technical nitty gritty, ull need some Windows background. there are resources out there that explain it far better than i ever could or would bother to
instead ill give u a shitty analogy:
instead ill give u a shitty analogy:
- an announcer(Windows) monitors whats going on around him
- there's a bunch of people(ur script and other programs) neatly queued in front of him
- when something interesting happens(such as physically depressing a key on a keyboard), he writes it down on a piece of paper and passes it to the first person in front of him
- uve collectively agreed(hopefully) to read whats on the paper and once ure done reading it, behave and pass the paper along to the next person behind u
- in comes an uncultured swine(RStudio), muscling through the entire queue and plants himself in front of the announcer
- expectedly, he receives the piece of paper, reads it and throws it away. why did he do this? did he not know he was supposed to pass it along? did he simply not care enough to do so? was it a purposefully malicious action? whatever the reason, it is usually not interesting(u could figure it out but thats getting way too involved). he got to read his paper, whereas u didnt even get the chance to
Re: RStudio refuses AutoHotkeys - (...why?)
Oh I always just assumed that AHK ran on top of everything by default, so I should launch it with administrator rights on ?
- Where could I find the "run with UI access option" ?
Re: RStudio refuses AutoHotkeys - (...why?)
Not necessarily admin rights, if you can avoid it - for the UI access option follow the FAQ link I posted above.
Re: RStudio refuses AutoHotkeys - (...why?)
I use RStudio with Autohotkeys with some success but my scripts are simple.asderad wrote: ↑28 Jul 2021, 07:20Dear members of the community,
If anyone of you is familiar with "RStudio" at all (R, programming language IDE) -
Is it normal that the software disables all AutoHotkeys once open ?
Only concerns the window itself too, switching to anything else and my layout works just fine.
(some of my A-Hkeys even crash the program altogether, eg. language switching)
Anyhow,
I would greatly appreciate any insights you guys might have on the matter.
Cheerios -
Code: Select all
#If WinActive("ahk_class Qt5QWindowIcon ahk_exe rstudio.exe")
!4:: Send, !tg
!5:: Send, {Down}{Tab 18}{Enter}
#If
However, if I try
Code: Select all
!4:: Send, !tg{Down}{Tab 18}{Enter}
Who is online
Users browsing this forum: Google [Bot], JoeWinograd and 182 guests