|
Device configuration These parameters can be used eiter as command line parameters (use prefix '-') or stored in the device configuration file. The configuration file name can be passed to pstros by parameter -c. Screen settings: device.width : set device screen width to XX pixels (default 176) device.height : set device screen height to XX pixels (default 220) device.bottomConsoleHeight : set bottom (command) console height (default is 0). When this parameter is set it indicates that console should be allways visible even in full screen mode. So use this parameter only if you know that device cannot hide the bottom console. Calling canvas.getHeight() in full screen mode allways returns the value set by "device.height" no matter wether the bottomConsoleHeight was set. Key settings: device.keyLeftSoft : set device key code for left soft key (default -6) device.keyRightSoft: set device key code for right soft key (default -7) device.keyCenterSoft: set device key code for center soft key - fire key (default -5) device.keyUpArrow: set device key code for up arrow (default -1) device.keyDownArrow: set device key code for down arrow (default -2) device.keyLeftArrow: set device key code for left arrow (default -3) device.keyRightArrow: set device key code for down arrow (default -4) device.keySelect: set integer value of either keyLeftSoft or keyRightSoft (default -6) device.keyBack: set integer value of either keyLeftSoft or keyRightSoft (default -7) The numbers should be actual keyCode integers acquired when Canvas.keyPress() is called on the device. Note: keySelect and keyBack values determine the position where pstros renders commands on bottom console. If values of keyLeftSoft and keySelect are equal then selection commands will be drawn on the left side of the console and vice versa. Font settings device.fontSizeSmall: set the small font size (default 10) device.fontSizeMedium: set the medium font size (default 12) device.fontSizeLarge: set the large font size (default 14) If you need to adjust the height (in pixels) that is returned from the font.getHeight() then specify following parameters: device.fontHeightSmall device.fontHeightMedium device.fontHeightLarge Other settings: device.videoMemory: defines the size of the video memory of the device in kPixels (default 1024). The video memory limit (along with current and peek values of the video memory) is displayed on the top of the window. Pstros throws an exception when the video memory is full. Note: exact video memory allocation /deallocation that matches the device behaviour is beyond the scope of the pstros (it depends on device implementation that handles the video memory fragmentation, how the device internally stores semitransparent images etc.). device.callEvent : defines sequence of events (delimited by ',' or ';' or space) when call test is invoked. List of available events: - startApp (or sa): calls startApp method on current MIDlet - pauseApp (or pa): calls pauseApp method on current MIDlet - showNotify (or sn): calls showNotify method on current Canvas - hideNotify (or hn): calls hideNotify method on current Canvas - screenOff (or s0): disable screen and repaints the screen with abstract pattern. - screenOn (or s1): enable screen, subsequent paints will be redirected to the current Canvas - wait (or w): wait for 1000 msecs. - waitXXX (or wXXX): wait for specified (XXX) msecs. Examples: Settings applied via command line parameters: java -jar pstros.jar mygame.jad -device.width=128 -device.height=144 -device.bottomConsoleHeight=16 -device.callEvent=pa,w,hn,w20,s0,w4000,sa,w,s1,sn Settings applied via configuration file: java -jar pstros.jar mygame.jad -cMY_device.cnf Content of the file MY_device.cnf might look like this: #this is the configuration for MY device device.width: 128 device.height: 144 device.bottomConsoleHeight: 16 device.callEvent: pa,w,hn,w20,s0,w4000,sa,w,s1,sn device.videoMemory: 380 device.fontSizeMedium: 14 device.fontHeightMedium: 20 |
|
PC configuration Some of the pstros UI parameters can be modified in the user configuration file. These parameters are not related to device emulation but are configurable for user convenience or operating system (desktop platform) constrains. The most important are parameters for mapping PC keyboard to the device keyboard and mapping other special keys (screen shot capture keys, show/hide notify keys etc.). Other parameters are related to emulator screen positions and dialog dimensions. The configuration file is stored in your home directory: ~/.pstros/params.cnf How to (re)define key control configuration: 1) modify configuration file and set parameter "control.config = 1" 2) run MIDP application in pstros and then exit the pstros 3) modify configuration file again and there should appear another parameters related to key mapping (like: control.keySoftLeft = 90 etc.). The number of the key code can be obtained by pressing Caps Lock key (to activate show_me_the_key_code_mode :-) and pressing the desired key on your keyboard while the pstros is running. On the system console you should see the printout of the last key code typed. |