* See Download section
SlyControl 2.3+
UDP Control plugin
ShortcutEvent
Copyright (C) Atis Lezdins aka xAM
atis.l@bf.rtu.lv
--------------------------------------------------------------
Description:
Primary idea of creating UdpEvents, was to have a server part
for ShortcutEvents. But it also can be used, for
remote-controlling SlyControl, over Network. UDP was chosen,
because of simplicity. All network communication is written,
using plain WinSock API.
ShortcutEvents was intended, for using in Windows Shortcuts.
For example, you can create a shortcut containing
'ShEvent START,MyAPP,0'
and add SlyControl hook, for starting that application. In hook,
you can write custom initialization scripts, and even more.
Also you can use the ShEvents, for controlling SlyControl
on remote computer. See Configuration for details.
--------------------------------------------------------------
Use:
ShEvent Data
where Data is comma separated values of Type,ID,Param and ExtParams.
See Protocol for details.
Plugin part (UdpEvents) must be started (UdpEvents.Start), in
order for SlyControl to receive events.
--------------------------------------------------------------
Configuration:
Use Plugin Setup dialog, for changing configuration. Configuration
are stored in 'udp.ini'. Port entry are shared for UdpEvents and
ShEvent. RemoteHost is used by ShEvent. BoundIP is used by UdpEvents.
--------------------------------------------------------------
Security:
For plugin, it's strongly recommended, not to change the BoundIP.
It is the address, passed to Bind() API, specifying, wich physical
address to use. Specifying 0.0.0.0 will listen on all IP addresses,
allowing Events to be recieved from internet. If you use 127.0.0.1
you will receive only Events, sent from loopback interface (that
is
127.0.0.1).
If you have decided to use the events-over-network, use some
firewall program, for security. In firewall settings, make, first
to accept UDP packets from [ip-of-computer-running-shevents] to
port [Port-in-inifile] and then to drop any other UDP
packets from [any-ip-address] to the [Port-ini-inifile].
Recommended value of BoundIP: 127.0.0.1
--------------------------------------------------------------
Protocol:
Type,ID[,Parameter[,ExtParam1[,ExtParam2[,ExtParam3[,ExtParam4]]]]]
Type - Event Type e.g. REMOTE, or KEY
ID - Event ID, e.g. TV, SCAN, ZOOM
Parameter - Event Parameter. Value, returned by hook. e.g. 0,1,2.
ExtParam1-4 - Extended parameters. Use quotes for strings. e.g.
'a',0,'zz'
--------------------------------------------------------------
Events: Any events.
--------------------------------------------------------------
Actions: No Actions.
--------------------------------------------------------------
Examples:
SlyControl Script:
TestEvent = Hook( "TEST", "EVENT", Enabled,
Break ){
OSD.ActionManual("TEST EVENT: <%s> <%s> <%d>",@1,@2,@3)
}
Shortcut target:
"C:\Program Files\SlyControl2\Plugins\UdpEvents\ShEvent.exe"
"TEST,EVENT,0,'Testing','extended events',555"
Output:
TEST EVENT: <Testing> <extended events> <555>
|
SlyControl 2.3+
Screen plugin
Copyright (C) Atis Lezdins aka xAM
--------------------------------------------------------------
Use: Useful, for automated changing of resolution. I created it,
because i had apps, that looks poor, on 1024x768, where i
normally work. Now, i write a small slycontrol script, that
changes resolution and starts app. When WinMon detects, that
app is closed, resolution is switched back.
--------------------------------------------------------------
Events:
Default type: "SCREEN"
CALLBACK_ALL
Event Value: 0
Ext parameter 1: Width and Height e.g. "640x480"
Ext parameter 2: Bits per pixel e.g. 32, 16, 8, 4
Ext parameter 3: Screen refresh rate (Vertical frequency) e.g. 100,
60
--------------------------------------------------------------
Actions:
ActionManual("ChangeRes_[Permanent|Temporal]" "XxY",
[BPP, [Refresh]] )
ActionManual(Value )
Commands:
The following commands return numeric
value of requested screen parameter.
---------------------------------------
WIDTH - Returns screen Width
HEIGHT - Returns screen Height
BITSPERPIXEL - Returns screen bpp
FREQUENCY - Returns screen frequency
---------------------------------------
ALL - Raises CALLBACK_ALL event, requires at least
new resolution specified specified in second
parameter.
--------------------------------------------------------------
Example:
IExplore = Group ( Enabled ){
OnGroupEnable(){ WinMon.StartPreset("IExplore") }
IexploreStart = Hook("WINMON","IEXPLORE_CREATE",Enabled,Break){
Screen.ActionManual("CHANGERES_PERMANENT","1280x1024",32,85)
h = WinMon.ActionPreset("IEXPLORE")
WinCtrl.ActionManual( "MAXIMIZE", h )
}
IexploreClose = Hook("WINMON","IEXPLORE_CLOSE",Enabled,Break){
h=WinMon.ActionPreset("IEXPLORE")
Break(h<>0)
Screen.ActionManual("CHANGERES_PERMANENT","1024x768",32,100)
}
}
Description:
This example requires WinMon to be configured to watch Internet
Explorer.
Whe IE is launched, resolution is switched to 1280x1024, 32 bits-per-pixel,
and 85 Hertz vertical refresh rate. When all instances of internet
explorer
is closed, resolution is set to 1024x768, 32 bits per pixel, and
100 Hertz.
Example:
Res = Hook("SCREEN","CALLBACK_ALL",Enabled,
Break, 1){
OSD.ActionManual("%s, %d bpp, %d Hz",@1,@2,@3)
}
ShowRes = Hook( "KEY", "Ctrl+Alt+R", Enabled,
Break ){
Screen.ActionManual("ALL")
}
Description:
This example shows current screen parameters.
|
SlyControl 2.3+
Clock plugin v1.0
Copyright (C) Atis Lezdins aka xAM
--------------------------------------------------------------
Use: The "FMT" action can be used, for displaying current
time
if you're watching TV, no need to minimize your TV-program.
YEAR,DATE,MONTH,HOUR,MINUTE,SECOND can be used for displaying
welcome screens, that differ, depending from time of day, etc.
It's not reccommended, to use them for displaying time. Use
FMT instead. Maybe also as primitive random-generator.
--------------------------------------------------------------
Events:
Default type: "CLOCK"
CALLBACK_FMT
Event Value: 0
Ext parameter 1: Formatted date and/or time
--------------------------------------------------------------
Actions:
ActionManual( Command, [format] )
Commands:
The following commands return numeric
value of requested date component.
---------------------------------------
YEAR - Returns current year
MONTH - Returns current month
DATE - Returns current date
HOUR - Returns current hour
MINUTE - Returns current minute
SECOND - Returns current second
---------------------------------------
FMT - Raises CALLBACK_FMT event, requires format
to be specified in second parameter. See Remarks.
--------------------------------------------------------------
Example:
Clock = Hook( "CLOCK", "", Enabled, Break ){
OSD.ActionManual( "%s", @1 )
}
ShowClock = Hook( "REMOTE", "SCAN", Enabled,
Break ){
Break( ShowClock <> 0 )
Clock.ActionManual( "FMT", "hh/mm/yyyy hh:nn:ss:zzz"
)
}
Output: 27/01/2003 10:22:04:172
Example:
Welcome = Hook( "REMOTECFG","START", Enabled){
h = Clock.ActionManual("hour")
s = Math.ActionManual("x/6",h)
skip(3,s=0)
skip(4,s=1)
skip(5,s=2)
skip(6,s=3)
OSD.ActionManual("Woohaa, time for vampires!")
Break()
OSD.ActionManual("Good morning, sir.")
Break()
OSD.ActionManual("Welcome back, commander. Welcome back!")
Break()
OSD.ActionManual("What's on the evening news?")
Break()
}
Output: from 00:00-06:59 (night) : Woohaa, time for vampires!
from 07:00-11:59 (morning) : Good morning, sir.
from 12:00-17:59 (day) : Welcome back, commander. Welcome back!
from 18:00-23:59 (evening) : What's on the evening news?
--------------------------------------------------------------
Remarks:
Time Formatting symbols:
c Displays the date using the format given by the ShortDateFormat
global variable, followed by the time using the format given by
the LongTimeFormat global variable. The time is not displayed if
the date-time value indicates midnight precisely.
d Displays the day as a number without a leading zero (1-31).
dd Displays the day as a number with a leading zero (01-31).
ddd Displays the day as an abbreviation (Sun-Sat) using the strings
given by the ShortDayNames global variable.
dddd Displays the day as a full name (Sunday-Saturday) using the
strings given by the LongDayNames global variable.
ddddd Displays the date using the format given by the ShortDateFormat
global variable.
dddddd Displays the date using the format given by the LongDateFormat
global variable.
e Displays the year in the current period/era as a number without
a leading zero (Japanese, Korean and Taiwanese locales only).
ee Displays the year in the current period/era as a number with
a leading zero (Japanese, Korean and Taiwanese locales only).
g Displays the period/era as an abbreviation (Japanese and Taiwanese
locales only).
gg Displays the period/era as a full name. (Japanese and Taiwanese
locales only).
m Displays the month as a number without a leading zero (1-12).
If the m specifier immediately follows an h or hh specifier, the
minute rather than the month is displayed.
mm Displays the month as a number with a leading zero (01-12). If
the mm specifier immediately follows an h or hh specifier, the minute
rather than the month is displayed.
mmm Displays the month as an abbreviation (Jan-Dec) using the strings
given by the ShortMonthNames global variable.
mmmm Displays the month as a full name (January-December) using
the strings given by the LongMonthNames global variable.
yy Displays the year as a two-digit number (00-99).
yyyy Displays the year as a four-digit number (0000-9999).
h Displays the hour without a leading zero (0-23).
hh Displays the hour with a leading zero (00-23).
n Displays the minute without a leading zero (0-59).
nn Displays the minute with a leading zero (00-59).
s Displays the second without a leading zero (0-59).
ss Displays the second with a leading zero (00-59).
z Displays the millisecond without a leading zero (0-999).
zzz Displays the millisecond with a leading zero (000-999).
t Displays the time using the format given by the ShortTimeFormat
global variable.
tt Displays the time using the format given by the LongTimeFormat
global variable.
am/pm Uses the 12-hour clock for the preceding h or hh specifier,
and displays 'am' for any hour before noon, and 'pm' for any hour
after noon. The am/pm specifier can use lower, upper, or mixed case,
and the result is displayed accordingly.
a/p Uses the 12-hour clock for the preceding h or hh specifier,
and displays 'a' for any hour before noon, and 'p' for any hour
after noon. The a/p specifier can use lower, upper, or mixed case,
and the result is displayed accordingly.
ampm Uses the 12-hour clock for the preceding h or hh specifier,
and displays the contents of the TimeAMString global variable for
any hour before noon, and the contents of the TimePMString global
variable for any hour after noon.
/ Displays the date separator character given by the DateSeparator
global variable.
: Displays the time separator character given by the TimeSeparator
global variable.
'xx' Characters enclosed in single quotes are displayed as-is, and
do not affect formatting.
|
|
|