LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 03-26-2005, 09:44 AM   #1
meblost
Member
 
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?
 
  


Reply


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/Novell 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


All times are GMT -5. The time now is 08:38 PM.

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