Itjustgivinguslike a bunchoflettersandthesekeyslikethis.
Wewanttosavethisintoprobably a taxfilers, somethingthatwe'regonnabeabletolookatbecausemostlikely, ifyou'recreating a keylogger, youprobablywanttodosomethingwiththekeysthatarebeingpressed.
Sowhat I'm gonnadois I'm goingtoimplement a fewvariableshereandexplainwhattheydoinjust a second.
So I'm goingtostartbysayingaccountequalzerokeysequals a blanklistandtheninsideofonpress, say, globalkeysandcount.
And I'm alsogonnacreateanotherfunctionhere, andthisoneisgonnabecalledrightunderscorefileonWhatthisisgonnadoisexactlywhatitsays.
It's goingtowriteto a file.
Sowhatwe'regonnasayadvancingwithopenandthen a textfilenameWhateveryouwantinthiscase, mindsoflongdirty X t, andthenwe'regonnaput a modehere.
Okay, Now, ifthefirsttimeyou'rerunningthis, youdon't have a textfellowcreatedandyou'retoolazytomakeonecoldforwhateveryouwannacallit, justputthisas W.
I don't knowwhyitshowsupinquotationmarks, butanyways, sothat's gonnaturninto a stringReplacedthequotationmarksNowthatwehaveitin a formthatwecanreadproperlywherefirst, we'lljustgottacheckifthisis a spacecharacter.
SoiftheuserhitthespacebarSothewaythatwecoulddothiswhenyousayitokay, I don't findthisiskindofthecheapwaytodoit, butwe'rejustgonnadothis, notspatespaceinhereequalsequalswhereactuallyisgreaterthanzero.