# Copyright (c) 2001 Mike Baker (mbm@linux.com) # $Id: webremote.itcl,v 1.17.2.1 2002/07/09 02:24:50 lightn Exp $ # # The sendkey form portion of this code and modifications # Copyright (c) 2001 Mike Langley (mlangley@owt.com), v1.1 source $tcl_library/tv/sendkey.tcl # disable keyname echoing to controling tty set verboseSendKeyG 0 namespace eval WEB_REMOTE { variable SONY "SonyDMRemoteImage.2" variable PHILIPS "PhilipsDMRemoteImage.13" variable MODEL "" } proc action_sendkey {chan path env} { global db global evrc evmw global url_prefix eval $env if {[string index $path 0] == "/"} { set path [string range $path 1 end] set cmds [split $path "/"] foreach key $cmds { set index [lsearch "thumbsdn volup voldown chanup chandn slow advance" $key] if {$index >= 0} { set key [lindex "thumbsdown volumeUp volumeDown surfup surfdown playslow catchup" $index] } if {[info exists evrc($key)] || [info exists evmw($key)] || $key == "wait"} { if {$key != "wait"} { SendKey $key } else { after 750 } } } } puts $chan [html_start "Web Remote"] puts $chan " " puts $chan "[html_link "?WEB_REMOTE::MODEL=text" "\[TEXT\]"]  [html_link "?WEB_REMOTE::MODEL=" "\[IMAGE\]"]

" if { $WEB_REMOTE::MODEL == "" } { RetryTransaction { if {[catch {set dummy [db $db open "/Resource/Image/$WEB_REMOTE::SONY"]}] != 1} { set WEB_REMOTE::MODEL "sony" } elseif {[catch {set dummy [db $db open "/Resource/Image/$WEB_REMOTE::PHILIPS"]}] != 1} { set WEB_REMOTE::MODEL "philips" } else { set WEB_REMOTE::MODEL "text" } } } set dir "/${url_prefix}sendkey/" if { $WEB_REMOTE::MODEL == "text" } { puts $chan "
WEB REMOTE
PowerTiVoLiveTV
 
 UP 
LEFT RIGHT
 DOWN 
 
ThumbsDnSelectThumbsUp
 
VolUpMuteChanUp
VolDnRecordChanDn
 
 Play 
ReversePauseForward
ReplaySlowAdvance
 
123
456
789
clear0Enter
" } elseif { $WEB_REMOTE::MODEL == "sony" } { puts $chan " " } elseif { $WEB_REMOTE::MODEL == "philips" } { puts $chan " " } # Adding shortcut key table puts $chan "
Key Action
<Up Arrow> <Enter> Play
<Right Arrow> '\]' Forward
<Left Arrow> '\[' Reverse
<Space Bar> 'p' Pause
<Down Arrow> 'a' Advance
'/' <Backspace> Replay
" puts $chan [html_end] } register_module "sendkey" "Web Remote" "A Web Based Remote Control for your TiVo"