This is an old AHK script I have been using for years that should allow for note taking without focus stealing. It's not mine and I am not sure who wrote it, test first etc.
Code:
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
#SingleInstance, Force
SetBatchLines, -1
Critical, On
$*,::
$*-::
$*.::
$*/::
$*0::
$*1::
$*2::
$*3::
$*4::
$*5::
$*6::
$*7::
$*8::
$*9::
$*;::
$*=::
$*[::
$*\::
$*]::
$*`::
$*a::
$*b::
$*c::
$*d::
$*e::
$*f::
$*g::
$*h::
$*i::
$*j::
$*k::
$*l::
$*m::
$*n::
$*o::
$*p::
$*q::
$*r::
$*s::
$*t::
$*u::
$*v::
$*w::
$*x::
$*y::
$*z::
$*Space::
$*Tab::
$*Enter::
$*Escape::
$*Backspace::
$*Delete::
$*Home::
$*End::
$*Up::
$*Down::
$*Left::
$*Right::
$*Numpad1::
$*Numpad2::
$*Numpad3::
$*Numpad4::
$*Numpad5::
$*Numpad6::
$*Numpad7::
$*Numpad8::
$*Numpad9::
$*Numpad0::
StringTrimLeft, ks_key, A_ThisHotkey, 2
process_key(ks_key)
return
process_key(ks_key)
{
ks_key_to_send = %ks_key%
; sending a special key? if so, wrap in brackets
ks_length := StrLen(ks_key)
if (ks_length > 1)
{
ks_key_to_send = {%ks_key%}
}
MouseGetPos, , , id
id2 := WinExist("A")
if (id != id2)
{
WinActivate, ahk_id%id%
}
Send, {blind}%ks_key_to_send%
}