最近调试j2me程序,要触摸事件支持,发现模拟器支持触摸事件,太好了,在device找到模拟器的配置文件,修改,将touch_screen=false 改成touch_screen=true就可以了。

## files that are necessary for the emulator to start: ##
## they are located at the same directory as this properties file

default_image=MediaPhoneNormal.png
pressed_buttons_image=MediaPhonePressed.png
highlighted_image=MediaPhoneHiLite.png

## version and configuration properties
version.profile=MIDP-2.1
version.configuration=CLDC-1.1

## screen properties ##

 # Screen location, relative to the top-left corner of the
 # telephone's image
 ###############
screen.x=43
screen.y=54

 # Screen size in pixels
 ###############
screen.width=180
screen.height=208

 # The region of the screen available to graphics commands
 # This section is optional. It defines the drawable region
 # of the screen to be a subregion of the whole screen area.
 ###############
screenPaintableRegion.x=0
screenPaintableRegion.y=11
screenPaintableRegion.width=180
screenPaintableRegion.height=178

 # pixel size ratio (shape of each pixel).
 # example: 1x1=square pixel, 1x2=rectangular pixel
 ###############
screenPixelRatio.x = 1
screenPixelRatio.y = 1

 # Touchscreen support
 ###############
touch_screen=false

 # Screen Background RGB Color
 # examples: 0xffffff = white, 0x000000 = black
 ###############

        #       Screen border RGB color is a color of softbuttons and icons
        #       area. If not defined, screen background color is used
        #       example: screenBorderColor = 0xf0f0f
        ###############
screenBorderColor=0xb6b6aa

        #       Transparency support
        #       SRC_OVER alpha composition rule
        #       supported by default
        ###############
enableAlphaChannel=true

netindicator.image: netIndicatorOn.png
netindicator.bounds: 36, 23, 17, 17

button.1 = 36, 378, 60, 31
button.2 = 102, 378, 60, 31
button.3 = 167, 378, 60, 31
button.4 = 36, 413, 60, 31
button.5 = 102, 413, 60, 31
button.6 = 167, 413, 60, 31
button.7 = 36, 448, 60, 31
button.8 = 102, 448, 60, 31
button.9 = 167, 448, 60, 31
button.ASTERISK = 36, 481, 60, 31
button.0 = 102, 481, 60, 31
button.POUND = 167, 481, 60, 31

button.SOFT1 = 36, 281, 60, 24
button.SOFT2 = 167, 281, 60, 24
button.SEND = 36, 307, 60, 24
button.END = 167, 307, 60, 24
button.HOME = 36, 334, 60, 24
button.CLEAR = 167, 334, 60, 24
button.POWER = 209, 19, 20, 20
button.LEFT = 100, 298, 14, 43
button.RIGHT = 150, 298, 14, 43
button.UP = 114, 283, 35, 14
button.DOWN = 114, 343, 35, 14
button.SELECT = 114, 298, 35, 43

command.keys.BACK = SOFT1
command.keys.EXIT = SOFT1
command.keys.CANCEL = SOFT1
command.keys.STOP = SOFT1

command.keys.OK = SOFT2
command.keys.SCREEN = SOFT2
command.keys.ITEM = SOFT2
command.keys.HELP = SOFT2

command.exclusive.SOFT1 = BACK, EXIT, CANCEL, STOP

command.menu.activate = SOFT2

keyboard.handler = com.sun.kvem.midp.DefaultKeyboardHandler

key.0 = VK_0 VK_NUMPAD0
key.1 = VK_1 VK_NUMPAD1
key.2 = VK_2 VK_NUMPAD2
key.3 = VK_3 VK_NUMPAD3
key.4 = VK_4 VK_NUMPAD4
key.5 = VK_5 VK_NUMPAD5
key.6 = VK_6 VK_NUMPAD6
key.7 = VK_7 VK_NUMPAD7
key.8 = VK_8 VK_NUMPAD8
key.9 = VK_9 VK_NUMPAD9
key.POUND = VK_SUBTRACT
key.ASTERISK = VK_MULTIPLY
key.POWER = VK_ESCAPE
key.UP = VK_UP
key.DOWN = VK_DOWN
key.LEFT = VK_LEFT
key.RIGHT = VK_RIGHT
key.SELECT = VK_ENTER
key.SOFT1 = VK_F1
key.SOFT2 = VK_F2
key.SEND = VK_HOME
key.END = VK_END
key.CLEAR = VK_BACK_SPACE

midlet.SUSPEND_ALL = VK_F6
midlet.RESUME_ALL = VK_F7

# Support of Key Repeat Events
# keyRepeatEvents = false
#

# Multiple font support:
# font.<face>.<style>.<size>=<font properties file name> |
#                                                     <system font definition>
# Where
# <face> is one of
# system, monospace, proportional
#
# <style> is one of
# plain, bold, italic
#
# <size> is one of
# small, medium, large
#
# Default font is defined by
# font.default=<font properties file name> | <system font definition>
#
# Soft Button font defined by
# font.softButton=<font properties file name> | <system font definition>
#

font.default=SansSerif-plain-10
font.softButton=SansSerif-plain-11


font.system.plain.small: SansSerif-plain-9
font.system.plain.medium: SansSerif-plain-11
font.system.plain.large: SansSerif-plain-14

font.system.bold.small: SansSerif-bold-9
font.system.bold.medium: SansSerif-bold-11
font.system.bold.large: SansSerif-bold-14

font.system.italic.small: SansSerif-italic-9
font.system.italic.medium: SansSerif-italic-11
font.system.italic.large: SansSerif-italic-14

font.system.bold.italic.small: SansSerif-bolditalic-9
font.system.bold.italic.medium: SansSerif-bolditalic-11
font.system.bold.italic.large: SansSerif-bolditalic-14

font.monospace.plain.small: Monospaced-plain-9
font.monospace.plain.medium: Monospaced-plain-11
font.monospace.plain.large: Monospaced-plain-14

font.monospace.bold.small: Monospaced-bold-9
font.monospace.bold.medium: Monospaced-bold-11
font.monospace.bold.large: Monospaced-bold-14

font.monospace.italic.small: Monospaced-italic-9
font.monospace.italic.medium: Monospaced-italic-11
font.monospace.italic.large: Monospaced-italic-14

font.monospace.bold.italic.small: Monospaced-bolditalic-9
font.monospace.bold.italic.medium: Monospaced-bolditalic-11
font.monospace.bold.italic.large: Monospaced-bolditalic-14

font.proportional.plain.small: SansSerif-plain-9
font.proportional.plain.medium: SansSerif-plain-11
font.proportional.plain.large: SansSerif-plain-14

font.proportional.bold.small: SansSerif-bold-9
font.proportional.bold.medium: SansSerif-bold-11
font.proportional.bold.large: SansSerif-bold-14

font.proportional.italic.small: SansSerif-italic-9
font.proportional.italic.medium: SansSerif-italic-11
font.proportional.italic.large: SansSerif-italic-14

font.proportional.bold.italic.small: SansSerif-bolditalic-9
font.proportional.bold.italic.medium: SansSerif-bolditalic-11
font.proportional.bold.italic.large: SansSerif-bolditalic-14

# Font underlining :
#
# Font underlining is enabled by default. It is possible to disable font
# underlining with
#
# font.all.underline.enabled=false
#
# or per font with
#
# font.<face>.<style>.<size>.underline.enabled=false

# Multistate icons support:
#
# icon.<name> = <x location>,<y location>,<initial state>
# icon.<name>.<state #1> = <state #1 image file name>
# ..
# icon.<name>.<state #n> = <state #n image file name>

icon.up: 86, 192, off
icon.up.off:
icon.up.on: ../Share/up.gif

icon.down: 86, 198, off
icon.down.off:
icon.down.on: ../Share/down.gif

icon.left: 78, 194, off
icon.left.off:
icon.left.on: ../Share/left.gif

icon.right: 94, 194, off
icon.right.off:
icon.right.on: ../Share/right.gif

icon.internet: 64, 1, off
icon.internet.off:
icon.internet.on: ../Share/internet.gif

icon.reception: 2, 1, on
icon.reception.on: ../Share/reception.gif

icon.battery: 164, 2, on
icon.battery.on: ../Share/batt.gif

icon.inmode: 83, 2, off
icon.inmode.off:
icon.inmode.ABC: ../Share/ABC.gif
icon.inmode.abc: ../Share/abc_lower.gif
icon.inmode.123: ../Share/123.gif
icon.inmode.kana: ../Share/kana.gif
icon.inmode.hira: ../Share/hira.gif
icon.inmode.sym: ../Share/sym.gif

icon.domain: 149, 0, off
icon.domain.off:
icon.domain.trusted: ../Share/trusted.png

#
# Sound support:
# alert.<alert_type>.sound: <sound file>
# Where possible <alert_type> are
#
# alarm
# info
# warning
# error
# confirmation
#
# Default sound type is used for all alerts where specific sound is not
# defined:
# alert.default.sound: <sound file>

alert.alarm.sound:   ../Share/mid_alarm.wav
alert.info.sound:    ../Share/mid_info.wav
alert.warning.sound: ../Share/mid_warn.wav
alert.error.sound:   ../Share/mid_err.wav
alert.confirmation.sound: ../Share/mid_confirm.wav
vibrator.sound: ../Share/vibrate.wav

# Softbuttons support:
# softbutton.<number>=<x location>,<y location>,<width>,<height>,<font>
#
# Coordinates are relative to the origin of the screen area.

softbutton.0=1,192,78,16, softButton, left
softbutton.1=99,192,78,16, softButton, right

#
# Gamma value for gamma-correction
# Default value is 1, which means that no gamma-correction is actually performed
#
#gamma=2

# Color/Grayscale screen support:
colorCount=0x1000
isColor=true
alphaLevelCount=0x100

 

相关文章:

看完了要说点啥么?