Read hotstring buffer

Get help with using AutoHotkey and its commands and hotkeys
gemisigo
Posts: 9
Joined: 08 Jul 2014, 03:29

Read hotstring buffer

21 Dec 2016, 13:45

Is there a way to fetch the contents of the hotstring buffer?
lexikos
Posts: 6885
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: Read hotstring buffer

22 Dec 2016, 03:01

No.
gemisigo
Posts: 9
Joined: 08 Jul 2014, 03:29

Re: Read hotstring buffer

22 Dec 2016, 09:59

And any intention to create one?
HotKeyIt
Posts: 2130
Joined: 29 Sep 2013, 18:35
Contact:

Re: Read hotstring buffer

22 Dec 2016, 14:52

In AutoHotkey_H you can use Input to do that:

Code: Select all

Gui,Add,Edit,r20 w800
Gui,Add,Text,,Input buffer:
Gui,Add,Edit,r10 w800
Gui,Add,Button,gClearInput,ClearInput
Gui,Show,,ReadingInput
SetTimer,ReadInput,100
Loop {
	Input,var,V,{Esc}{Space}
	If (Errorlevel="EndKey:Escape")
		break
	else if (var="btw")
		Send {BS 4}By the way
	else if (var="ahk")
		Send {BS 4}AutoHotkey
}
GuiClose:
ExitApp
ReadInput:
GuiControl,,Edit2, % var
Return
ClearInput:
var:=""
Return
gemisigo
Posts: 9
Joined: 08 Jul 2014, 03:29

Re: Read hotstring buffer

22 Dec 2016, 19:11

Hmm, interesting approach. Not exactly what I need, but pretty close. Thank you very much, HotKeyIt.
Helgef
Posts: 4412
Joined: 17 Jul 2016, 01:02
Contact:

Re: Read hotstring buffer

23 Dec 2016, 04:45

I guess there can be many cases when this approach doesn't reflect the real buffer. Maybe it can fit your needs with some modifications.

Code: Select all

#Hotstring EndChars `n`t

Gui,Add,Edit, w800
Gui,Add,Text,,Input buffer:
Gui,Add,Edit, w800
Gui,Show,,ReadingInput
return
GuiClose:
ExitApp
Return

; Reset buffer, eg:
~*LButton::
~*RButton::
	buf:=""
	GuiControl,,Edit2, % buf
return

; Erase from buffer
~*BS::
	buf:=SubStr(buf,1,-1)
	GuiControl,,Edit2, % buf
return

; Imitate buffer - context sensitive in case you want to use single letter hotstrings, eg, ::h::hello
#If g()
:*?CB0:!::
:*?CB0:#::
:*?CB0:$::
:*?CB0:%::
:*?CB0:&::
:*?CB0:'::
:*?CB0:(::
:*?CB0:)::
:*?CB0:*::
:*?CB0:+::
:*?CB0:,::
:*?CB0:-::
:*?CB0:.::
:*?CB0:/::
:*?CB0:0::
:*?CB0:1::
:*?CB0:2::
:*?CB0:3::
:*?CB0:4::
:*?CB0:5::
:*?CB0:6::
:*?CB0:7::
:*?CB0:8::
:*?CB0:9::
:*?CB0:;::
:*?CB0:<::
:*?CB0:=::
:*?CB0:>::
:*?CB0:?::
:*?CB0:@::
:*?CB0:A::
:*?CB0:B::
:*?CB0:C::
:*?CB0:D::
:*?CB0:E::
:*?CB0:F::
:*?CB0:G::
:*?CB0:H::
:*?CB0:I::
:*?CB0:J::
:*?CB0:K::
:*?CB0:L::
:*?CB0:M::
:*?CB0:N::
:*?CB0:O::
:*?CB0:P::
:*?CB0:Q::
:*?CB0:R::
:*?CB0:S::
:*?CB0:T::
:*?CB0:U::
:*?CB0:V::
:*?CB0:W::
:*?CB0:X::
:*?CB0:Y::
:*?CB0:Z::
:*?CB0:[::
:*?CB0:\::
:*?CB0:]::
:*?CB0:^::
:*?CB0:_::
:*?CB0:a::
:*?CB0:b::
:*?CB0:c::
:*?CB0:d::
:*?CB0:e::
:*?CB0:f::
:*?CB0:g::
:*?CB0:h::
:*?CB0:i::
:*?CB0:j::
:*?CB0:k::
:*?CB0:l::
:*?CB0:m::
:*?CB0:n::
:*?CB0:o::
:*?CB0:p::
:*?CB0:q::
:*?CB0:r::
:*?CB0:s::
:*?CB0:t::
:*?CB0:u::
:*?CB0:v::
:*?CB0:w::
:*?CB0:x::
:*?CB0:y::
:*?CB0:z::
:*?CB0:{::
:*?CB0:|::
:*?CB0:}::
:*?CB0:~::
:*?CB0: :: ; Space
:*?CB0:"::
:*?CB0:¤::
:*?CB0:£::
:*?CB0:€::
return
#if
g()
{
	global buf
	buf.= SubStr(A_ThisHotkey,8,1)
	GuiControl,,Edit2, % buf
	return 0
}

Return to “Ask For Help”

Who is online

Users browsing this forum: boiler, Google [Bot], Maz, pils, TAC109 and 254 guests