text: var rx=require("rx");function normalizeKeypressEvents(a){return{value:a[0],key:a[1]}}module.exports=function(a){return{line:rx.Observable.fromEvent(a,"line"),keypress:rx.Observable.fromEvent(a,"keypress",normalizeKeypressEvents),normalizedUpKey:rx.Observable.fromEvent(a,"keypress",normalizeKeypressEvents).filter(function(b){return b.key&&(b.key.name==="up"||b.key.name==="k")}).share(),normalizedDownKey:rx.Observable.fromEvent(a,"keypress",normalizeKeypressEvents).filter(function(b){return b.key&&(b.key.name==="down"||b.key.name==="j")}).share(),numberKey:rx.Observable.fromEvent(a,"keypress",normalizeKeypressEvents).filter(function(b){return b.value&&"123456789".indexOf(b.value)>=0}).map(function(b){return Number(b.value)}).share(),spaceKey:rx.Observable.fromEvent(a,"keypress",normalizeKeypressEvents).filter(function(b){return b.key&&b.key.name==="space"}).share(),}};