#!/tvbin/tivosh source $tcl_library/tv/log.tcl source $tcl_library/tv/sendkey.tcl set id "" proc EventMwStatus { type EventType } { global EventData global id env switch $EventType \ $TmkEventMwStatus::CONTEXT_PING_ACK { binary scan $EventData II iContext serialNumber if { $serialNumber == $id } { set id "" } } \ default { } } event register $TmkEvent::EVT_MW_STATUS EventMwStatus ######## # # SendKeyAndWait # # Send a key & wait until the context manager has handled it. # ######## proc SendKeyAndWait { key } { global id SendKey $key set id [SendKey ping] set count 0 while { $id != "" } { incr count if { $count > 200 } { error "Event timed out." } after 250 update } } foreach key $argv { SendKeyAndWait $key }