手機(jī)上的Soft Keys問題[javaME]
Posted on 2005-12-26 15:16 讓變化成為計(jì)劃的一部分 閱讀(675) 評(píng)論(0) 編輯 收藏 所屬分類: J2ME我的個(gè)人觀點(diǎn),不知道對(duì)不對(duì)(http://community.csdn.net/Expert/topic/4477/4477765.xml?temp=.6836969):
你所說的KEY_SOFTKEY1,KEY_SOFTKEY2,KEY_SOFTKEY3這幾個(gè)定義,應(yīng)該是Nokia UI API中的FullCanvas定義的吧?
而MIDP2.0的Canvas規(guī)范并沒有定義這幾個(gè)。
請(qǐng)看:
《Series 60 Developer Platform 2.0: Specification v1.0》,
Page 77:
Left soft key, -6, "Left soft key" or left soft-key symbol
Right soft key, -7, "Right soft key" or right soft-key symbol
Middle soft key, -5, "Select", "Middle soft key" or similar symbol
所以我們的Nokia、Samsung和SonyEricsson專有程序中會(huì)這么定義:
/**
* Key code for the FIRE game action.
*/
public static final int KEY_FIRE = -5;
/**
* Key code for left soft key
*/
public static final int KEY_SOFT_LEFT = -6;
/**
* Key code for right soft key
*/
public static final int KEY_SOFT_RIGHT = -7;
在摩托羅拉專有的程序中則這么定義:
/**
* Key code for the FIRE game action.
*/
public static final int KEY_FIRE = 20;
/**
* Key code for left soft key
*/
public static final int KEY_SOFT_LEFT = 21;
/**
* Key code for right soft key
*/
public static final int KEY_SOFT_RIGHT = 22;
在西門子程序中則這么定義:
/**
* Key code for the FIRE game action.
*/
public static final int KEY_FIRE = -26;
/**
* Key code for left soft key
*/
public static final int KEY_SOFT_LEFT = -1;
/**
* Key code for right soft key
*/
public static final int KEY_SOFT_RIGHT = -4;
Softkeys并沒有被包含在MIDP2.0的規(guī)范中,所以,
如果你非要在手機(jī)上使用這幾個(gè)Softkeys,那么請(qǐng)注意手機(jī)的差異,你可能需要針對(duì)不同款手機(jī)分別定義了。
以下對(duì)撥打電話的手機(jī)按鍵的定義是在nokia、三星和Motorola(v80/220/300/400/500/600, e398, c650):
/**
* Key code for PHONE_ON key (green button)
*/
public static final int KEY_PHONE_ON = -10;
以下這種定義是在西門子:
/**
* Key code for PHONE_ON key (green button)
*/
public static final int KEY_PHONE_ON = -11;
以下這種定義是在Motorola platform phones iDEN, T280, T72x, v6x
/**
* Key code for PHONE_ON key (green button)
*/
public static final int KEY_PHONE_ON = -14;