craftleft.gif (3002 bytes)QuickTable
Home | API | Tutorial | Download | Support | Contact topblack.gif (108 bytes)


QuickTable User Cp  |  Register  |  Members  |  Search  |  Help
    |- QuickTable Discussion Forums > Events/Actions Post New Topic   Post A Reply
Disable keystrokes printer friendly version
next newest post | next oldest post
Author Messages
jfaath
Private

Gender: Unspecified
Location:
Registered: May 2005
Status: Offline
Posts: 1

Click here to see the profile for jfaath Send email to jfaath Send private message to jfaath Find more posts by jfaath Edit or delete this message Reply w/Quote
Posted Tuesday, May 3, 2005 @ 13:09:54  

Is there a way to disable the default keystrokes? For example, pressing F3 seems to bring up the "Find" screen but I need F3 for another menu item. Attempting to assign the F3 accelerator to my menu item results in nothing happening when F3 is pressed.

Another thing I noticed is when I first start the application, pressing F3 brings up the "Find" dialog, but after I close it this dialgo, pressing F3 no longer does anything.

Thanks,

JF

Admin
Board Owner

Gender: Unspecified
Location:
Registered: Jul 2003
Status: Offline
Posts: 9

Click here to see the profile for Admin Send email to Admin Send private message to Admin Find more posts by Admin Edit or delete this message Reply w/Quote
Posted Wednesday, May 4, 2005 @ 22:33:47  

To disable the required keystrokes, first unregister and then add your own keystrokes

Example

Code:
dbTable.getTable().unregisterKeyboardAction(KeyStroke.getKeyStroke(KeyEvent.VK_F3,0));

F3 not showing the find window the second time is a bug. It will be fixed in next release.

baric
Unregistered
Edit or delete this message Reply w/Quote
Posted Tuesday, April 18, 2006 @ 03:43:20  

I've tried to unregister Tab-Key as suggested:

getTable().unregisterKeyboardAction(KeyStroke.getKeyStroke(KeyEvent.VK_TAB,0));

However, this does not disable this key.

Admin
Board Owner

Gender: Unspecified
Location:
Registered: Jul 2003
Status: Offline
Posts: 9

Click here to see the profile for Admin Send email to Admin Send private message to Admin Find more posts by Admin Edit or delete this message Reply w/Quote
Posted Tuesday, April 18, 2006 @ 08:40:09  

There are two types of keys. Some keys are added by quicktable Ctrl+F etc. Some are java JTable keys example TAB. QuickTable key events can be disabled using unregisterKeyboardAction. If you want to catch the TAB key, you need to use the InputMap

Code:

JTable table = dbTable.getTable();
table.getInputMap(JTable.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.­getKeyStroke("TAB"), "disableTab");

//the code below may not be needed
//add this code only if the above line creates any exception
table.getActionMap().put("disableTab", new AbstractAction()
{
public void actionPerformed(ActionEvent e)
{
//don't do any thing
}
}

Post New Topic   Post A Reply Jump to:
Contact Us | QuickTable - A Java DBGrid | Privacy Policy All times are GMT -5 Hours.
Welcome to QuickTable Forums, Guest!  
Login
Username :
Password :
In order to fully utilize the abilities of this board, you are required to register as a member. Registration is free, and allows you to do lots of things including turning on or off certain features of this board. Register now!
Powered by CuteCast v2.0 BETA 2
Copyright © 2001-2003 ArtsCore Studios