![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: Mar 2006
Location: Lebanon
Posts: 148
Rep Power: 3
![]() |
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. |
|
|
|
|
|
#2 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,798
Rep Power: 5
![]() |
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? |
|
|
|
|
|
#3 |
|
Caffeinated Neural Net
Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 920
Rep Power: 4
![]() |
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 |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
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 |