I havetriedtoalleviatethisproblembygettingmyselfsomeeconomicaccessoriesformyprogram.
Thefirstbigthisanchorverticalmousewiththebuttons a mountedonthesite.
Youdon't havetotwistmywristtouse a regularmarathonsurface.
Secondly, I gotmyself a logictech G 13 lefthandedprogrammablekeyboard, which, asthenamesuggests, it's foryourlefthand, andyoucanuseyourthumbtomanipulatethelittlejoysticklikethisonyou.
Typicallyin a game, forexample, displaythestatsofthegame, liveammo, healthorinyourvideoeditingapplication, youcandisplaythetimelinescrubberso I wantedtoseehoweasywasittoprogramthisthingonDhe.
I think I'm goingtotryandgetittodisplaythetwitchchapatthetop, soitwillbe a similartoparvideo.
OnthenameofthelipislogicTech L C d LibDon't liblovely.
Justbefore I forget, theydoactuallyprovideboththe 32 64 bitvariantsofthelibrary.
Sojusttomakesurethat I'm building a 32 bitexecuteherbal, I'm justgoingtomakesureitusestherightlibrarytoincludethelibrary.
WesimplyincludeLogitechLCD, libdot h.
Thecompilerknowswheretolooktoitbecausewe'vesetthedirectory, and I justliketohave a littletestcompiledtomakesurethatwe'vegotthingssetup.
Thefirstthingtorememberaboutthislockdetected E 13 keyboardisitdoesn't reallydoanyprocessingonthedeviceitself.
Thescreeniscompletelypassive.
It's mycomputer, whichisdevelopingbasicallyanimagefilethatitsendstothescreenSoourapplicationwillcreateanimagefileonsenditsusingtheirAP I downtothedevice.
WecanalsousetheFBItogetthestatusoffourbuttons.
That's allfromus.
Notallofthekeys, butjustthefourbuttons, whichareusedtointeractwiththisdisplayforthetimebeing, andtomakethings a littleclearer, I'm goingtoenable a magicextracameratheresowecanseewhatthedisplayscurrentlywelldisplayingoneofthebuiltinapple.
It's fortheLogitechTree 13 keyboard.
SimplydisplacetheCPUandRAMusagevalleysOnda.
Asyoupressbuttons, youcanchoosedifferentprograms, so I'm usingDaVinciresultsformyvideoediting.
Forexample, I don't think I'vegotanythingelseinsalt, butwedon't usethesebuttonstoworkwithwhateverappleitiscontrollingtheothertasks.
Sothere's nothinggoingontheandyes, okay, I'vepaid a littlebitofelitedangerousrecently s.
It's butofcourse, theseathletesaren't runningonmy G 13.
Theyarerunningonmycomputer.
Thefirstthingwithanydriversweneedtomakesurewecanloadthedriveritselfbecauseit'llbe a deal l A sharedlivelyfileandtodothisintheheadoffilethatwe'vebeengiven.
Thereis a function.
Alloftheselogicones, bytheway, beginwithLAGeeOndaspecificallylodge E L C D.
Sowecanseeinthedropdownlist.
ThingsthatarepoppingupforisalreadylargelyLCDinitishowwillbegin, andweneedtogiveit a friendlynameasyoujustsawit.
Thiswouldbewhereitsaidelitedangerous.
Forexample, it's goingtodisplayourname.
So I'm goingtocallthisonetheoneloneKodatestthat's goingtothenameofourlittleappleit, whichisgoingtoruninparallelwiththeotherapple.
It's onthisdeviceondhe.
I'm goingtotellitthatactually, it's a monochromeLCDdisplay.
So I'm goingtochooseLinezero, whichwillbeatthetop.
Andwe'regoingto, ofcourse, sayhelloWorldonDon't forgetagainthatit's UnicodeNow, anytimeyoumake a changetothedisplay, youneedtoactuallyinformthedriverthatyouwanttoupdatethedisplay, whichinthiscase, isthelodge E l C d o updatefunction.
Sowe'venothadtotellittomakeourappleitthefocus, orbringittothefrontofthisstackofabsentofrunningonthedeviceandjusttogiveit a realworkout.
I'm goingtonowgettosetallfourlinesoftextsowecanseethedisplayupdating a lotmore.
AndsonowcalltheLCDupdatefunctionagain.
Andtherewego.
Verynice.
TheLogitechAP.
I alsoprovidesroutinesfordisplayinganimagebasedonblackandwhitepixels.
I'm notgoingtousethattoday.
Asthelawprotectdocumentationisquiteforeignandprovides a workingexampleofhowtodothis, thereisonefinallineofcoderequiredjusttomakesurewereallycleanupeverythingproperly.
Andthat's hislargeLCDshutdown.
Withthisverybasicprogramopenrunning, wecannowcreate a skeletonprogramforsomething a littlemoresophisticatedyou'd usuallywanttousethiskeyboardtodisplaysomesortofrealtimeinformationonDA.
Wewouldtypicallyhave a littleprogramloophere, whichgatherssomeinformationabout a thing, andthendoesallofthedrawcallsontheupdatefunctionandit'llsitin a loopjustrepeatedlydoingthat.
Andit's thegatheringinformationabout a thing, whichistherealchallenge.
That's a lotofdevelopersnowactuallyprovidingtoolsand a P I.
C u caninteractwiththeapplicationonceit's runningandgetinformationaboutstate, forexample, in a gameyoumightbeabletogethowmanybulletsyougotleft, youcouldsimplymake a querytothegamethat's runningonyourapple.
Itorapplicationcanthenusethatinformation.
Howeveritseesfit.
Notallgamesdothis, andsothatcouldbequite a challenge.
Togetaccesstothatinformation, I'm notgoingtogointogamemodelingforthisvideobecause I willbe a veryspecificvideo.
NowtheTwitchchapBackEndusesInternetrelaychattelIRC, whichhasbeenaroundforages, and a fairlyestablishedprotocolforcommunicatingsimplechatacrossthenetworkonCometothinkofit, thisisthefirsttimethatwe'vedonenetworkingontheoneloancodeddotcomblock, whichmeanssuddenly I'm gonnahavetointroducesocketsin a waythat's understandableandfriendly.
OnWindowssocketsare a bitof a mess, Sothecodethat I'm goingtousetodayistheburnminimumrequiredtoget a socketworking.
Sowe'regoingtocreate a socket, whichwilltalktothetwitchchatsoveron.
Oncewe'vecreatedoursocket, wecallthisconnectfunction, whichtakesussockonagaintakestheaddressinformationthatwe'vecreatedbeforesotheaddressinformationisquiteanimportantstructurethatnotjustcontainsthe I P number, butalsotheothernetworksettingsrequiredtocreatethattypeofconnection.
Whenevertwitchesfinishsendingsomethingitalwaysputson a newlineor a returnlinecharacterattheendsowecanusethatbasically, topartitionourcommandsintoindividuallines.
Someone's goingtodisplaythecharacterequivalentofthestringeverytimeTwitchsends a newcommand.
So I'vecompiledandruntheprogramnow, andwecanseethemessagesthatswitchesreturns.
Thatwelcomesmetoitsserverhas, ah, bitof a referenceto a veryoldcomputergameonDivetolditthat I wanttojointheJavid X ninechatroom, whichismytwitchedchatroom, andifactive, I gothereandthere.
Andsonow I'vepulledupsortofmytwitchpagehere I canchatandsayhello?
Andonceweget a validlinegoingtopoptheexistingoneatthefrontandatthebackofthelistandputsournewchat, whichincludestheusernameonwhatthey'resayingnow, wecanconsiderthelogicthatkeyboardagain.
Wejustwanttodisplaythefourlinesoftext.
So I'm goingtouse a littleautohereonour S lineslist, and I'llusetheLogitechfunction.
Margie L C D manosettexton.
I'm goingtoneedtostoreinindex.
I'lljustcreate a quicktempervariablecalled P here.
I wanttodisplaythestring.
I wasgoingtosetthisto P equalszeroandaftereachone p plusplus.
Butwe'vegot a fewareascroppingupherenow, sowe'veonlygotfourlinesinourlistonweneedtheindex 012 andthreetoactourfunction, andwewanttodisplaythetax.
However, thethefunctionprovidedbylogictakisexpecting a doubleyouchartypecharacterrateandnot a string.
Thisis a bitfiddly.
A verysimpleandquickwaytoconvertfrom a stringto a W stringistousetheassignedfunction.
Sowetakeourexistingstringhere.
Yearsiterated, zitsbeginandendpointson.
Weassignthatsothiswilldothecharacterconversionon a characterbycharacterbasis.
It's notveryefficient, butit'lldothejobsohopefullythenwecanjustpassinthewidecharacterstringAlternative W X stoleuswouldhangonthisstolenerrorhereandsuddenlyThiserroralsoenhancesmybeliefthatthelibraryandtheSDKwaswrittenbytheinternallogicTechisthatthey'venotusedconstcorrectlyinthiscase.
So I'm goingtohavetodo a reallydirtylittleworkaroundhacktogetthistoworkinthat I'm goingtocastto a W tchArtiepointerbeforehand.
Ifthedeveloperofthesdkhadincludedconstantthefunction, thatwouldn't be a needtodothisandoutsidedon't seewhytheywouldneedtobeabletochangethebufferthatthey'rebeingsent.