Datasheet
52 SYMBIANOSGAMEBASICS
S60 to disable key blocking for the application and accept multiple key
press events. However, this is not possible on UIQ.
One other thing to note about input is that phone keypads have a
limited number of keys, which are not always ergonomic for game play.
The variety of layouts and the size limitations need to be considered when
designing a game, and ideally should be configurable, through a menu
option, so the user can choose their own, according to their preference
and the smartphone model in question. It is also a good idea to design
games to always allow for one-handed play, since some devices are too
small for game playing to be comfortable using both hands. However,
other devices are suited to two-handed game playing, particularly when
they can be held in landscape orientation, such as the Nokia N95 or the
Nokia N81. The instance where phones can be used in both portrait and
landscape orientations, and the game supports each mode, is another
good reason for allowing the game keys to be configurable. The user can
set different key configurations for gameplay depending on the orientation
of the phone.
2.5 Handling Input from the Screen
Some UIQ smartphones, such as the Sony Ericsson P1i, support touch-
screen input, which can be used to add another mode of user interaction
to a game. Screen events can be detected and handled in much the same
way as keypad input, by overriding CCoeControl::HandlePointer-
EventL() as shown below. In the example given, to capture events that
occur in the close vicinity of a particular point on the screen, an area of
the screen is constructed, ten pixels square, and centered on the point
in question. When a pointer-down screen event occurs, if the point at
which the tap occurred lies within the square, the user input is stored in
a bitmask in the same way as for a key press.
void CSkeletonUIQView::HandlePointerEventL(const TPointerEvent&
aPointerEvent)
{
if (TPointerEvent::EButton1Up == aPointerEvent.iType)
{// Pointer up events clear the screen
iKeyState = 0x00000000; // clear all previous selections
}
else if (TPointerEvent::EButton1Down == aPointerEvent.iType)
{
TRect drawRect( Rect());
TInt width = drawRect.Width();
TInt height = drawRect.Height();
TPoint offset(10,10); // 10x10 square around the screen position
TPoint k1(width/4, height/2);