cliclick开源项目

我要开发同款
匿名用户2021年11月17日
45阅读
开发技术JavaScript
所属分类应用工具、终端/远程登录
授权协议View license

作品详情

cliclickOverview

cliclick(shortfor“CommandLineInterfaceClick”)isatoolforexecutingmouse-andkeyboard-relatedactionsfromtheshell/Terminal.ItiswritteninObjective-CandrunsonOSX10.15orlater.

Formoreinformationorfordownloadingacompiledbinary,pleasetakealookatcliclick’shomepage

Author:CarstenBlüm,Website:www.bluem.net

Usage

Togetaquickfirstimpression,thisiswhatyouwillgetwhenyouinvokecliclick-h:

USAGEcliclick[-r][-m<mode>][-d<target>][-e<num>][-f<file>][-w<num>]command1[command2]OPTIONS-rRestoreinitialmouselocationwhenfinished-m<mode>Themodecanbeeither“verbose”(cliclickwillprintadescriptionofeachactiontostdoutjustbeforeitisperformed)or“test”(cliclickwillonlyprintthedescription,butnotperformtheaction)-d<target>Specifythetargetwhenusingthe“p”(“print”)command.Possiblevaluesare:stdout,stderr,clipboardorthepathtoafile(whichwillbeoverwrittenifitexists).Bydefault(ifoptionnotgiven),stdoutisusedforprinting-e<easing>Setaneasingfactorformousemovements.Thehigherthisvalueis(default:0),themorewillmousemovementsseem“natural”or“human-like”,whichalsoimplies:willbeslower.Ifthisoptionisused,theactualspeedwillalsodependonthedistancebetweenthestartandtheendposition,i.e.thetimeneededformovingwillbehigherifthedistanceislarger.-f<file>Insteadofpassingcommandsasarguments,youmayinsteadspecifyafilefromwhichcliclickwillreadthecommands(orstdin,when-isgivenasfilename).Eachlineinthefileisexpectedtocontainacommandinthesameformat/syntaxascommandsgivenasargumentsattheshell.Additionally,linesstartingwiththehashcharacter#areregardedascomments,i.e.:ignored.Leadingandtrailingwhitespaceisignored,too.-w<num>Waitthegivennumberofmillisecondsaftereachevent.Ifyoufindthatyouusethe“wait”commandtoooften,using-wcouldmakethingseasier.Pleasenotethat“wait”isnotaffectedby-w.Thismeansthatinvoking“cliclick-w200wait:500”willwaitfor700milliseconds.Thedefault(andminimum)valuefor-wis20.-VShowcliclickversionnumberandreleasedate-oOpenversionhistoryinabrowser-nSendadonationCOMMANDSTousecliclick,youpassanarbitrarynumberofcommandsasarguments.Acommandconsistsofacommandidentifier(astringthattellscliclickwhatkindofactiontoperform)andusuallyoneormoreargumentstothecommand,whichareseparatedfromthecommandidentifierwithacolon.Example:“c:123,456”isthecommandforclicking(the“c”isthecommandidentifierforclicking)atthepositionwithxcoordinate123andycoordinate456.Seebelowforalistofallcommandsandtheargumentstheyexpect.Wheneveracommandexpectsapairofcoordinates,youmayproviderelativevaluesbyprefixingthenumberwith“+”or“-”.Forexample,“m:+50,+0”willmovethemouse50pixelstotheright.Ofcourse,relativeandabsolutevaluescanbemixed,andnegativevaluesarepossible,so“c:100,-20”wouldbeperfectlyvalid.(Ifyouneedtospecifyabsolutenegativevaluesincaseyouhaveasetupwithaseconddisplayarrangedtotheleftofyourmaindisplay,prefixthenumberwith“=”,forinstance“c:100,=-200”.)LISTOFCOMMANDSrc:x,yWillRIGHT-CLICKatthepointwiththegivencoordinates.Example:“rc:12,34”willright-clickatthepointwithxcoordinate12andycoordinate34.Insteadofxandyvalues,youmayalsouse“.”,whichmeans:thecurrentposition.Using“.”isequivalenttousingrelativezerovalues“c:+0,+0”.m:x,yWillMOVEthemousetothepointwiththegivencoordinates.Example:“m:12,34”willmovethemousetothepointwithxcoordinate12andycoordinate34.kd:keysWilltriggeraKEYDOWNeventforacomma-separatedlistofmodifierkeys.Possiblekeysare:-alt-cmd-ctrl-fn-shiftExample:“kd:cmd,alt”willpressthecommandkeyandtheoptionkey(andwillkeepthemdownuntilyoureleasethemwithanothercommand)kp:keyWillemulatePRESSINGAKEY(keydown+keyup).Possiblekeysare:-arrow-down-arrow-left-arrow-right-arrow-up-brightness-down-brightness-up-delete-end-enter-esc-f1-f2-f3-f4-f5-f6-f7-f8-f9-f10-f11-f12-f13-f14-f15-f16-fwd-delete-home-keys-light-down-keys-light-toggle-keys-light-up-mute-num-0-num-1-num-2-num-3-num-4-num-5-num-6-num-7-num-8-num-9-num-clear-num-divide-num-enter-num-equals-num-minus-num-multiply-num-plus-page-down-page-up-play-next-play-pause-play-previous-return-space-tab-volume-down-volume-upExample:“kp:return”willhitthereturnkey.tc:x,yWillTRIPLE-CLICKatthepointwiththegivencoordinates.Example:“tc:12,34”willtriple-clickatthepointwithxcoordinate12andycoordinate34.Insteadofxandyvalues,youmayalsouse“.”,whichmeans:thecurrentposition.Note:Ifyoufindthatthisdoesnotworkinatargetapplication,pleasetryifdouble-clickingplussingle-clickingdoes.ku:keysWilltriggeraKEYUPeventforacomma-separatedlistofmodifierkeys.Possiblekeysare:-alt-cmd-ctrl-fn-shiftExample:“ku:cmd,ctrl”willreleasethecommandkeyandthecontrolkey(whichwillonlyhaveaneffectifyouperformeda“keydown”before)dm:x,yWillcontinuetheDRAGeventtothegivencoordinates.Example:“dm:112,134”willdragandcontinuetothepointwithxcoordinate112andycoordinate134.c:x,yWillCLICKatthepointwiththegivencoordinates.Example:“c:12,34”willclickatthepointwithxcoordinate12andycoordinate34.Insteadofxandyvalues,youmayalsouse“.”,whichmeans:thecurrentposition.Using“.”isequivalenttousingrelativezerovalues“c:+0,+0”.dd:x,yWillpressdowntoSTARTADRAGatthegivencoordinates.Example:“dd:12,34”willpressdownatthepointwithxcoordinate12andycoordinate34.Insteadofxandyvalues,youmayalsouse“.”,whichmeans:thecurrentposition.w:msWillWAIT/PAUSEforthegivennumberofmilliseconds.Example:“w:500”willpausecommandexecutionforhalfasecondp[:str]WillPRINTthegivenstring.Ifthestringis“.”,thecurrentMOUSEPOSITIONisprinted.Asaconvenience,youcanskipthestringcompletelyandjustwrite“p”togetthecurrentposition.Example:“p:.”or“p”willprintthecurrentmousepositionExample:“p:'Helloworld'”willprint“Helloworld”du:x,yWillreleasetoENDADRAGatthegivencoordinates.Example:“du:112,134”willreleaseatthepointwithxcoordinate112andycoordinate134.cp:strWillPRINTTHECOLORvalueatthegivenscreenlocation.Thecolorvalueisprintedasthreedecimal8-bitvalues,representing,inorder,red,green,andblue.Example:“cp:123,456”mightprint“127630”dc:x,yWillDOUBLE-CLICKatthepointwiththegivencoordinates.Example:“dc:12,34”willdouble-clickatthepointwithxcoordinate12andycoordinate34.Insteadofxandyvalues,youmayalsouse“.”,whichmeans:thecurrentposition.t:textWillTYPEthegivenTEXTintothefrontmostapplication.Ifthetextincludesspace(s),itmustbeenclosedinquotes.Example:“type:Test”willtype“Test”Example:“type:'VieleGrüße'”willtype“VieleGrüße”Limitations

Itisnotpossibletousecliclickbeforeauserlogsin,i.e.:tocontroltheloginwindow.

Buildingcliclick

EitherbuildinXcode,asusual,orbuildfromtheshellbycdingintotheprojectdirectoryandtheninvokingeitherxcodebuildormake(whateveryouprefer).Ineithercase,cliclickwillnotbeinstalled,butyouwillsimplygetanexecutablecalled“cliclick”intheprojectdirectorywhichyoucanthenmovewhereveryouwanttohaveit.(Youcanputitanywhereyoulike.)Toinstallitto/usr/local/bin,youcanalsosimplyinvokesudomakeinstall,whichwilldothisforyou.

PleasenotethatwhilethecodewillrunonOSX10.9andlater,BaseSDKandarchitecturesselectedintheXcodeprojectaresettothecurrentSDK.Therefore,ifyouwanttobuildforanoldersystem,besuretochangethesesettingsaccordingly.Ifyouhaveproblemswhenbuildingandgetamessagecomplainingaboutundefinedsymbols,chancesarethatthiscanbefixedbydisabling“ImplicitlylinkObjective-CRuntimeSupport”inthebuildsettings.

Contributing

Ifyouwouldliketocontributeanewfeature,abugfixorotherimprovement,pleasedosousingapullrequest.However,pleasetakecarethat:

Thereisonepullrequestpertopic.I.e.:ifyouwouldliketocontributeanewfeatureandtwobugfixes,openthreepullrequests.AllcommitmessagesareinEnglish.Ideally,allnon-obviousfeaturesorchangesshouldbeshortlyexplained.Thismightnotonlyincludewhatyoucommitted,butalsowhyyoudidit(motivation,usagescenario,…).
声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论