|
|
NAME
wce - Windows Mobile native extension
SYNOPSIS
DESCRIPTION
The wce command is used to provide access to low level
system functions from Tcl running on Windows Mobile. It is part of the
wce package, which is part of the eTcl for Windows Mobile
distribution, and which have to be loaded as:
- package require wce
It can take several
different forms, depending on the option argument. The legal forms are:
platform,
locale,
sipshow,
siphide,
sipinfo,
menuheight,
captionheight,
scrollbarheight,
power,
alive,
battery,
play,
netup,
netdown,
netinfo,
bluetooth,
phone,
wifi,
gps,
sipbuttonon,
sipbuttonoff,
fullscreen,
normalscreen,
orientation,
inputmode,
tapandhold,
keyoff,
keyon, and
framebuffer.
- wce platform
- Return Windows mobile platform for this device. Possible returned
values are
pocketpc or smartphone
- wce locale
- Return default locale for device, in ISO639 form.
- wce sipshow
- Pop up SIP (Software Input Panel)
- wce siphide
- Pull down SIP (Software Input Panel)
- wce sipinfo
- Returns the region of screen left available for application, to not be
covered by SIP frame. This region is returned as a list of 4
integer coordinates {left top right bottom}
- wce menuheight
- Give default height for a menuheight on current platform
- wce captionheight
- Give default height for caption bar on current platform
- wce scrollbarheight
- Give default height for scrollbar on current platform
- wce power ?status?
- If no status is specified, return the current power state of screen. If
power is specified, as a valid boolean value, set the screen power
state. When state is off, handheld looks off, backlight and LCD are
both turned off, but actually only display is disabled, and
programs continue running normally.
- wce alive
- Reset idle timer. One may call this command at regular interval to
prevent device to enter in suspend mode.
- wce battery ?-force
- Query battery status. Status is returned as a list of key
value options describing charge information for both main
battery and backup battery. Since fields ordering may change in the
future, it is recommended to save this list as an array or dict, and
retrieve information from names. Currently, information returned is
always -acstatus status -flag flag -percent percent
-time seconds -fulltime seconds -backupflag flag -backuppercent
percent -backuptime seconds -backupfulltime seconds. Possible
values for status are offline, online, battery or unknown. Battery flag
may have value high, low, critical, charging, none or
unknown. percent and seconds are positive
integer value, or -1 if information isn't available.
- wce play
- wce play filename ?options ...?
- When called with no argument, this command stop any sound playing in
background. When called with at least one argument, it plays sound
in file filename. Possible options are:
- -sync: block until sound file has been played
- -loop: repeat play. This can't be called with -sync, since this
would block forever.
- -nostop: The specified sound event will yield to another sound
event that is already playing. If a sound cannot be played
because the resource needed to generate that sound is busy
playing another sound, the function immediately returns FALSE
without playing the requested sound. If this flag is not
specified, PlaySound attempts to stop the currently playing
sound so that the device can be used to play the new sound.
- -nowait: If the driver is busy, return immediately without playing the sound.
- -nocomplain: Don't raise error, even if playing sound failed
(e.g. device busy, sound file doesn't exist, ...)
This command is a direct wrapper around PlaySound() function in
Windows Mobile API. For more advanced and portable sound playing,
see package evodio.
- wce netup
- wce netdown
- wce netinfo
- Obsolete. Commands to expose ConnMgr API at Tcl level. See bluetooth,
phone and wifi commands instead.
- wce bluetooth ?status?
-
If called with no argument, return state of bluetooth radio device as boolean
value. If called with one boolean argument, switch bluetooth
connection off or on. If status is string discoverable,
switch bluetooth connection on and register device as
discoverable. This command relies on system API available
from Windows Mobile 5, and only some Windows Mobile 2003 second
edition devices. When API is not available, this command may raise
an error which should be catched for compatibility with older
devices.
- wce phone ?status?
-
If called with no argument, return state of phone radio device as boolean
value. If called with one boolean argument, switch phone connection
off or on. This command relies on system API available
from Windows Mobile 5, and only some Windows Mobile 2003 second
edition devices. When API is not available, this command may raise
an error which should be catched for compatibility with older
devices.
- wce wifi ?status?
-
If called with no argument, return state of wifi radio device as boolean
value. If called with one boolean argument, switch wifi connection
off or on. This command relies on system API available
from Windows Mobile 5, and only some Windows Mobile 2003 second
edition devices. When API is not available, this command may raise
an error which should be catched for compatibility with older
devices.
- wce gps ?status?
-
Query GPS information using GPS Intermediate Driver (GPSID) (Windows Mobile 5
or better). If no GPS driver is available, an error is raised. GPS
status is returned as a list of key value. List of fields
may vary from one device to another. Possible values are utc,
latitude, longitude, knots (speed in knots), speed (speed in km/h),
heading, magnetic_variation, altitude, altitude_ellipsoid, dilution,
horizontal_dilution, vertical_dilution, count (number of satellites
used), inview (number of satellites in view).
- wce sipbuttonon window
- Make SIP (Software Input Panel) button visible
- wce sipbuttonoff window
- Make SIP (Software Input Panel) invisible
- wce fullscreen toplevel
- Set toplevel state to fullscreen, so window can be displayed
with no menu or caption bar. However, this doesn't set window
geometry, so a wm geometry command must still be issued to
have the window actually be fullscreen.
- wce normalscreen toplevel
- Restore toplevel state to normal (default), as opposite to
fullscreen state.
- wce orientation ?angle?
- Set or query display orientation. If an
angle is specified, either as an integer value (in degrees), or one
of portrait or landscape keywords, command tries to apply this
display orientation. THis command always return current orientation
(in degrees) (0 for portrait, 90 for landscape).
- wce inputmode window mode
- Set input mode for window. Valid input modes are spell,
ambiguous, numbers, text and off (default).
- wce tapandhold window mode
- Set tap&hold support for window. Valid modes are
off, on and auto.
When enabled, a tap on widget will start displaying small
balls as a countdown, and if user maintains tap long enough,
right mouse click (ButtonPress-3
and ButtonRelease-3 sequence) is simulated on window. Mode
auto is similar to on, but the original
ButtonPress-1 event is also sent to window. The auto mode
will probably be renamed in next releases.
- wce keyoff keyname ?window?
- Disable events for special keys. keyname must be one of
soft1, soft2,
volumeup, volumedown,
record, end,
home, back,
talk,
app1, app2, app3, app4,
app5, app6, app7, app8,
app9, app10, app11, app12,
app13, app14, app15, or app16.
- wce keyon keyname ?window?
- Enable events for special keys. See keyoff for list of valid key
names.
- wce framebuffer ?window?
- Experimental. This command initializes a direct access to framebuffer,
which can then be connected to a Pixane handler to draw on it. It
makes possible to implement a fullscreen application for PocketPC,
without actually requiring Tk. It requires GAPI (Microsoft Game
API) extension to be
available on your system. Default eTcl release has GAPI support
disabled, so this subcommand will always fail.
|