473,624 Members | 2,564 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mobile phone keyboard

Does anybody have any idea how to write a c++ console application which
simulates the mobile phone keyboard ?
for Example: when i write SMS
I hit 2 - I get "a"
I hit 22 - I get "b"
I hit 222 - I get "C";
Please help.

thanks for all replays
boruh
skype: Flyboruh
Jul 23 '05 #1
3 4641
"Tomasz "Boruh" Borowiak @interia.pl>" <flyboruh<WYTNI J> wrote in message
news:d1******** **@inews.gazeta .pl...
Does anybody have any idea how to write a c++ console application which
simulates the mobile phone keyboard ?
for Example: when i write SMS
I hit 2 - I get "a"
I hit 22 - I get "b"
I hit 222 - I get "C";
Please help.

thanks for all replays
boruh
skype: Flyboruh


Hello

Well, you can define the phone-keyboard-to-ascii-mapping as:

std::map<int> m;
int lasthitcounter = 0;
m[2]="abc";
m[3]="def";
m[4] = .... etc...

Now whenever you encounter a key press you increase the counter if the
keypress is the same as the old one (make sure you rotate the count if it
exceeds the strlen(m[keypress]), else you display
m[keypressNo][lasthitcounter] etc....

That's just a hint on how you can do it...

Hope that helps,
Elias
Jul 23 '05 #2
> That's just a hint on how you can do it...

Hope that helps,
Elias


thanks for help

new idea new project :)

when i finish i send you my source code

Jul 23 '05 #3

"lallous" <la*****@lgwm.o rg> wrote in message
news:39******** *****@individua l.net...
"Tomasz "Boruh" Borowiak @interia.pl>" <flyboruh<WYTNI J> wrote in message
news:d1******** **@inews.gazeta .pl...
Does anybody have any idea how to write a c++ console application which
simulates the mobile phone keyboard ?
for Example: when i write SMS
I hit 2 - I get "a"
I hit 22 - I get "b"
I hit 222 - I get "C";
Please help.

thanks for all replays
boruh
skype: Flyboruh
Eh?


Hello

Well, you can define the phone-keyboard-to-ascii-mapping as:

std::map<int> m;
int lasthitcounter = 0;
m[2]="abc";
m[3]="def";
m[4] = .... etc...

Now whenever you encounter a key press you increase the counter if the
keypress is the same as the old one (make sure you rotate the count if it
exceeds the strlen(m[keypress]), else you display
m[keypressNo][lasthitcounter] etc....

That's just a hint on how you can do it...

Hope that helps,
Elias


That won't help much if you want to be able to enter letters from the same
numeric key, such as 'a' and then 'b'. You need a way to tell when you're
done with a specific entry.

I don't know about your cell phone, but mine has a timer of some sort that
waits to see if I'm going to hit the same key a second (or third or fourth)
time.

One way would be to query the system time when a keypress is detected.
Then, loop, until either a key is pressed or a certain amount of time has
passed. If a *different* key is pressed, or if the allotted time has passed,
save the current value you want and prepare to receive the next one (or do
whatever other actions you need, such as dialing if the user hits Enter).
If the *same* key is pressed and the time has not expired, then increment
your current value (i.e., from 'a' to 'b'), and if it's not at the limit of
presses for that key, then re-enter the loop to check for more hits.
(Otherwise, since more hits are not legal, treat it as if the counter has
expired and move on.)

Interrupt-driven events are another possibility.

BUT!....

The problem here is that there is no way in standard C++ to check for
keypresses! The streaming mechanisms wait for the user to press the
Enter/Return key before the data becomes visible via the stream. (Likewise,
interrupts are not part of standard C++.)

To accomplish the task, you'll need to use some operating-specific
extensions of your compiler. For details on how to do that, check on a
newsgroup devoted to your platform (e.g., windows, unix, mac), or for your
compiler (e.g., vc++).

-Howard



Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4776
by: Mario | last post by:
Hello, Excuse me if I am not so clear on what I a looking for, but its getting very hard to find any software,application or information that will let me access or get a frame(still image) from a web cam or ip cam. I have different ip cams connected to the internet, they continuously send images refreshed over the internet.
1
4638
by: Jose Gonzalez | last post by:
How to apply a numeric format to a textbox using xhtml? I know you have to use the "-wap-input-format" style tag in css. I can get this to work in a regular xhtml page, however, I've been unsuccessful in getting it to work in asp.net 1.1 The following code has allowCustomAttributes set and works fine for labels, but not for textboxes. This is because it is building span tags around the control. I need to embed the class tag inside the...
3
4060
by: perspolis | last post by:
Hi all thanks in advance to read my post. I created a TAPI application and in this application I monitor the digits that user enter by phone.. it works well when I call from a phone but it dosen't work when I call from a mobile.it can't detect digits from mobile..I mean the MONITORDIGIT event dosen't fire when I call from mobile. I don't know why??
3
9108
by: Sara | last post by:
HI, I want to code a program to detect GSM mobile (any kind) which connected through serial port to computer and then be able to send SMS through this mobile phone to other mobile phones, could anyone help me and guide me, I wrote a program which could open COM port but still couldn't detect mobile phone and send SMS through it. I searched internet and I didn't find right answer to my question. please if anyone could guide me. the...
4
7004
by: Sara | last post by:
Hi I want to code a program which could send SMS through web page to mobile phone, but because there is no Service here such as SMPP , therefore I have GSM mobile phone which connected directly to the server which run these aspx pages. now my question is 1- how to detect this mobile phone which connected through serial ports 2- how I could send SMS through this mobile to other mobile devices, if anyone has any suggestion please help me
0
1739
by: James Nong | last post by:
I built an ASP.NET mobile web application last year for fun and hosted it on my home server. I was successful in accessing it with my Sprint phone, which uses the "Obigo 1.1.4 WAP 2.0" browser. Now, I'm with Verizon and my current phone also uses an Openwave WAP 2.0 browser, but I cannot access my mobile web site. When I punch in the URL, it hangs for long time, then it gives me the error "Error: Request timed out". I asked a friend...
3
4106
by: Melson | last post by:
Hi May I know is there a way to change the Numeric keypad into mobile phone keypad? Regards Melson
852
28299
by: Mark Tarver | last post by:
How do you compare Python to Lisp? What specific advantages do you think that one has over the other? Note I'm not a Python person and I have no axes to grind here. This is just a question for my general education. Mark
0
3187
terryble
by: terryble | last post by:
hy, We are deploying IPPhone cisco(R) On this phone proprietary code exist with XML too. After code modification, a can't find the final step for this service to work. I need to post the variable named "l" on the next page. This variable is the Last name reference to search a name on a corporate directory. here are the 2 pages of code first it's a keyboard like html clickable picture it refere coordinates to zone from the TouchArea tag...
0
8231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8168
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8614
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7153
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6107
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4075
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4167
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.