Bug 71538

Summary: Support to get and set keyboard key state
Product: [Eclipse Project] Platform Reporter: Dani Megert <daniel_megert>
Component: SWTAssignee: Felipe Heidrich <eclipse.felipe>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: bradleyjames, chandrayya.gk, cocoakevin, d_a_carver, gorkem.ercan, karel.brezina, KetanPadegaonkar, markus.kell.r, pwebster, s.wende, sizaki, steve_northover, tlroche
Version: 3.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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.