BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 03-26-2009, 07:20 AM   #1 (permalink)
New Member
 
Join Date: Mar 2009
Model: 8100
PIN: N/A
Carrier: sss
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Porting issues :j2me to blackberry,

Please Login to Remove!

Hi everyone,

i want to port j2me app i.e. midp application to blackberry but lot of porting issues are there:

1. i am using textfield made up of low level api, so for finding which char or key is pressed we use this:

private boolean keyPressedAny(int keyCode){
char charToAppend;
if(keyCode>=Canvas.KEY_NUM0 && keyCode<=Canvas.KEY_NUM9){
if((intPrevKey == keyCode)&&((currPressTime - prevPressTime)<=TIMEDELAY)){
intKeyPressCount++;
if(characters[keyCode-Canvas.KEY_NUM0].length<intKeyPressCount){
intKeyPressCount = intKeyPressCount%characters[keyCode-Canvas.KEY_NUM0].length;
}
charToAppend = characters[keyCode-Canvas.KEY_NUM0][intKeyPressCount-1];
replaceChar(charToAppend);
}else{
intKeyPressCount = 1;
charToAppend = characters[keyCode-Canvas.KEY_NUM0][intKeyPressCount-1];
addChar(charToAppend);
}
intPrevKey = keyCode;
return true;
}
return false;
}

and we can display that char.

but when any key is pressed in blackberry ,keycode are not in proper form to be mapped with any array and its not unique also for every key

i tried implementing KeyListener, KeyPadListener and override keyChar() method also, but control is not going.


plz suggest me any solution or other solutions for this problem.
otherwise login it self not work
plz help
Offline  
Old 03-27-2009, 02:05 PM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: May 2008
Model: 8700
PIN: N/A
Carrier: Telcel
Posts: 69
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Look for the Blackberry_MIDlet_Developer_Guide, there is a section on which are the MIDlet key mapping buttons based on the BB model
Offline  
Old 03-28-2009, 01:32 PM   #3 (permalink)
New Member
 
Join Date: Mar 2009
Model: 8100
PIN: N/A
Carrier: sss
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up

Thanks for a reply, but problem is like :
i made a text field in canvas and i need a mapping for each and every key, but mapping is given for
Space
Canvas.FIRE Q
Canvas.GAME_A W
Canvas.GAME_B O
Canvas.GAME_C P
Canvas.GAME_D R, U
Canvas.UP F, J, C, N
Canvas.DOWN D, H ,A ,L
Canvas.LEFT G, K, S
Canvas.RIGHT

for this much key only.

can i uses any rim api for catching key events,
in midlet
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

2SK1413 Original New Sanyo N-Channel Silicon MOSFET K1413
$4.99
2SK1413 Original New Sanyo N-Channel Silicon MOSFET K1413 picture(1PCS) 80SQ040 DIODE SCHOTTKY 40V 8A DO-204AR
$3.08
(1PCS) 80SQ040 DIODE SCHOTTKY 40V 8A DO-204AR pictureSANYO STK4121II
$6.25
SANYO STK4121II picture(1PCS) IXGH28N60B3D1 IGBT 66A 600V TO-247 28N60 IXGH28N60
$7.23
(1PCS) IXGH28N60B3D1 IGBT 66A 600V TO-247 28N60 IXGH28N60 pictureRF output transistors (NEW) 2N5945 Pack of 2 UHF OP 407-512 mhz 4 watts
$44.6
RF output transistors (NEW) 2N5945 Pack of 2 UHF OP 407-512 mhz 4 watts picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.