473,883 Members | 2,186 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 4656
"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
4800
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
4662
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
4074
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
9149
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
7016
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
1752
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
4122
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
29117
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
3215
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
9948
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...
1
10864
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10422
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
9588
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
7980
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
7137
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4623
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4230
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3242
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.