maby this is what you´re looking for. i use this to start timelines or call functions …
keypress.hype.zip (47,9 KB)
also you have to stop current timeline, if it was played:
if(event.keyCode == 65) { // A
hypeDocument.startTimelineNamed('timeline-1');
var tl = hypeDocument.currentTimeInTimelineNamed('timeline-1');
if(tl ==1){
hypeDocument.pauseTimelineNamed('timeline-1')
}
}
} else if(event.keyCode == 66) { // B
hypeDocument.startTimelineNamed('timeline-2');
}