Помогите с 3-мя кнопками и while

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Помогите с 3-мя кнопками и while

Re: Помогите с 3-мя кнопками и while

Post by garry » 30 Sep 2019, 13:21

@djuga22 ,спасибо

Re: Помогите с 3-мя кнопками и while

Post by djuga22 » 30 Sep 2019, 12:58

Решение нашел
Found Answer

Code: Select all

#persistent
Hotkey, 1, Test,On,UseErrorLevel
Hotkey, 2, Test,On,UseErrorLevel
Hotkey, 3, Test,On,UseErrorLevel
return

RButton::
While GetKeyState("Rbutton","P")
{
Tooltip,%Key%,(A_screenwidth)/2, (A_screenheight)/2,1
}
tooltip
return

Test:
Key := A_ThisHotkey
return
esc::exitapp

Re: Помогите с 3-мя кнопками и while

Post by djuga22 » 30 Sep 2019, 10:59

garry wrote:
30 Sep 2019, 09:50
?

Code: Select all

#persistent
Hotkey, 1 ,Test,On,UseErrorLevel
Hotkey, 2 ,Test,On,UseErrorLevel
Hotkey, 3 ,Test,On,UseErrorLevel
return

Test:
btx=Rbutton
Key  := A_ThisHotkey
	While (GetKeyState(btx,"P"))   ;- Rbutton and Hotkey1-3 pressed 
      {
	  Tooltip,%Key%,(A_screenwidth)/2, (A_screenheight)/2,1
      sleep,2000
      tooltip
      }
return
esc::exitapp

Does not work while the RMB button is pressed, past ones are not called

Re: Помогите с 3-мя кнопками и while

Post by garry » 30 Sep 2019, 09:50

?

Code: Select all

#persistent
Hotkey, 1 ,Test,On,UseErrorLevel
Hotkey, 2 ,Test,On,UseErrorLevel
Hotkey, 3 ,Test,On,UseErrorLevel
return

Test:
btx=Rbutton
Key  := A_ThisHotkey
	While (GetKeyState(btx,"P"))   ;- Rbutton and Hotkey1-3 pressed 
      {
	  Tooltip,%Key%,(A_screenwidth)/2, (A_screenheight)/2,1
      sleep,2000
      tooltip
      }
return
esc::exitapp

Помогите с 3-мя кнопками и while

Post by djuga22 » 29 Sep 2019, 22:49

Если нажать кнопку 1 затем 2 и 3, то ToolTip выдаст все верно, но если потом нажать снова 1,2,3 ToolTip покажет последнею нажатую кнопку,
то есть 3, задача получить последний нажатый Key, ToolTip просто для примера,понятное дело что while в процессе, но все же кнопки меняются и не меняются лишь те, что бы ли нажаты до этого

Code: Select all

Hotkey, 1 ,Test,On,UseErrorLevel
Hotkey, 2 ,Test,On,UseErrorLevel
Hotkey, 3 ,Test,On,UseErrorLevel

Test:
test := true
Key = %A_ThisHotkey%
	Tooltip,%Key%,(A_screenwidth)/2, (A_screenheight)/2,1
	while  (test = true) ; Это для примера, здесь будет GetKeyState("Rbutton", "P")
	{
		test := true ; Переменная для теста что бы не было спама, вместо этого здесь будет Send,{%Key%}
	}
	SetTimer, RemoveToolTip, 1
return

RemoveToolTip:
	SetTimer, RemoveToolTip, Off
	ToolTip
return

Top