Bug 289520 - Provide a way to find out what characters can be typed with hardware keys
Summary: Provide a way to find out what characters can be typed with hardware keys
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 150087 307992
  Show dependency tree
 
Reported: 2009-09-15 15:40 EDT by Markus Keller CLA
Modified: 2019-09-06 15:36 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2009-09-15 15:40:05 EDT
SWT should provide a way to find out what characters can be directly typed with hardware keys with the current keyboard layout.

JFace should use that support in org.eclipse.jface.bindings.BindingManager.getBestActiveBindingFor(ParameterizedCommand) to avoid showing keybindings that are unreachable for the user.

E.g. in bug 150087 the "Back" command is bound to "Command+Alt+Left" and "Command+[", but the latter is only available as a hardware key on US keyboard layouts, but not on most international keyboards. Currently, JFace has no way to know whether it can show the shorter "Command+[" or whether it should show the fallback that's accessible on all keyboards.

I'm open to how the API in SWT would look like:
- It could be a method on Display that checks a single character (I see code for this already in the post(Event) method) and returns either just a boolean to tell whether the character is directly mapped to a key, or even a result that tells what modifier keys need to be pressed to generate the character or if it is not typeable at all.
- It could also be a method that returns a char[] with all characters that are directly typeable without modifiers.
- It could return a mapping from characters to keycodes that generate the respective characters.
- ... whatever is easiest to implement for SWT
Comment 1 Felipe Heidrich CLA 2009-10-15 12:33:46 EDT
I looked quickly at win32 and the only API that can help here is VkKeyScan (and VkKeyScanEx).
Comment 2 Eclipse Webmaster CLA 2019-09-06 15:33:13 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
Comment 3 Eclipse Webmaster CLA 2019-09-06 15:36:59 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.