Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 03-26-2005, 09:44 AM   #1
Registered: May 2004
Location: At Keyboard
Distribution: Mandrake 10.0, SuSE 9.0
Posts: 114

Rep: Reputation: 15
Java - Search for alt or ctrl modifiers in a string

I am writing a program that prompts the user for a sql statement and then executes the statement by sending it to a mysql connection, sort of like the mysql shell.

However, I would like to perform certain actions if the user presses alt-h (or ctrl-h, I don't care which), for example, run a previously entered sql statement or save the current query if the user presses alt-s (or ctrl-s).

My problem is that I don't know how to determine if the string provided by the user contains either alt or ctrl.

Note that, for now, this is a console based application, not a swing based program, therefore, I cannot use KeyListeners, KeyEvents, etc.

How can I determine if a string contains any alt or ctrl modifiers?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Lost my Ctrl-Alt-Fx davcefai Debian 13 11-15-2005 11:46 PM
No alt-ctrl-F7/F8 spotslayer SUSE / openSUSE 3 04-26-2005 07:50 PM
dark screen when pressing Ctrl + Alt + Backspace or Ctrl + Alt F1-F6 in Gnome or KDE trinoo Slackware 5 01-28-2005 08:13 AM
Switching window focus (like alt+tab in windows) and Ctrl+Alt+F1 X windows problem... DiZASTiX Linux - Software 3 01-20-2005 04:56 PM
Ctrl-Alt-F* Fiskarn Mandriva 2 10-15-2003 02:44 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:55 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration