Bug 71538 - Support to get and set keyboard key state
Summary: Support to get and set keyboard key state
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 enhancement with 6 votes (vote)
Target Milestone: ---   Edit
Assignee: Felipe Heidrich CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-06 03:50 EDT by Dani Megert CLA
Modified: 2014-06-24 07:14 EDT (History)
13 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2004-08-06 03:50:47 EDT
R3.0

I tried use the Scroll Lock key for a view and failed due to
1) getting the Scroll Lock state was only possible via internal code:
     OS.GetKeyState(OS.VK_SCROLL)
2) found no way to set the Scroll Lock state
     e.g. OS.SetKeyState(OS.VK_SCROLL, boolean);

Another example is to show the CAPS Lock state in the status line when editing
text and allow to toggle it via double-click.
Comment 1 Steve Northover CLA 2004-08-09 12:37:37 EDT
FH and SN to look into this.  Setting and getting the keyboard state on non-
Windows platforms is problematic.  Perhaps we could just support querying the 
NumLock and ScrollLock state.
Comment 2 Stefan Xenos CLA 2004-10-08 17:39:48 EDT
This is similar to bug 74736, which asks for a way to get the current state of
modifier keys (ctrl, alt, and shift).
Comment 3 Kevin Barnes CLA 2009-04-13 10:30:54 EDT
caps lock is another interesting case.
Comment 4 Ketan Padegaonkar CLA 2009-04-13 10:36:17 EDT
Here's my usecase:

I need to be able to type the text 'Hello World' using the automation api. In
order to type 'H', I need to be able to decide whether I should be holding the
shift key down(or not) based on the state of the CAPS key.

This is a blocker for swtbot to be able to use the new automation api that the
swt team is providing.

Raising severity and version number to 3.5
Comment 5 Felipe Heidrich CLA 2009-04-13 15:43:11 EDT
Steve, this will require new API.

Note: at this point we will need PMC approval to add any new API for Eclipse 3.5
Comment 6 Chandrayya CLA 2014-06-24 07:14:21 EDT
We can set warning control decorator to password text filed if CAP LOCK is ON.