Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 5th, 2008, 7:47 AM   #1
hbe02
Hobbyist Programmer
 
hbe02's Avatar
 
Join Date: Mar 2006
Location: Lebanon
Posts: 148
Rep Power: 3 hbe02 is on a distinguished road
shift key escape sequence

is there an escape sequence to be entered in a string that would perform the functionality of the shift key.
in other words, is there a sequence XX such that "XYa" = "A" or "XY4" = "$"
thanks.
hbe02 is offline   Reply With Quote
Old Mar 5th, 2008, 8:34 AM   #2
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,798
Rep Power: 5 Sane will become famous soon enough
Re: shift key escape sequence

I believe the shift keys are ordinal values 14/15 or so. It probably varies between Windows and Linux too. If you were to use them as a sequence to literally shift before a character, it might be something like printf("%ca", 15). But, as far as I know, that does not work.

Why not use a prebuilt function for capitalizing letters? What do you need to do this for anyways?
Sane is offline   Reply With Quote
Old Mar 5th, 2008, 9:05 PM   #3
lectricpharaoh
Caffeinated Neural Net
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 920
Rep Power: 4 lectricpharaoh will become famous soon enough
Re: shift key escape sequence

Have you checked Sun's Java API documentation? You can do what you want by using the Robot class to simulate input. It does come with some caveats, but it should get you started. Note that you'll need to simulate press and release events. For the virtual key codes used in Java, see the KeyEvent class.

If all you want to do is map lowercase letters to their uppercase counterparts, you can use a lookup table, switch() block, or the Java API methods to accomplish this (things like String.toUpperCase() and similar methods).
__________________
A man's knowledge is like an expanding sphere, the surface corresponding to the boundary between the known and the unknown. As the sphere grows, so does its surface; the more a man learns, the more he realizes how much he does not know. Hence, the most ignorant man thinks he knows it all. - L. Sprague de Camp
lectricpharaoh is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
convert image sequence to quicktime movie rwm Java 10 Nov 28th, 2007 11:12 AM
mysql - question about numeric key programmingnoob Other Scripting Languages 2 Aug 22nd, 2007 5:20 PM
Press any key to continue... 357mag C# 6 May 16th, 2007 5:10 PM
\ as a character, not escape sequence b1g4L Python 2 Dec 7th, 2006 9:32 AM
shift randomly TecBrain C++ 7 Jul 22nd, 2005 8:59 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:42 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC