jEdit Community - Resources for users of the jEdit Text Editor
shortcuts: differentiating between keys: left/right ALT key, left/right CTRL key and the left/right WIN key
Submitted by homeathouse on Friday, 24 October, 2008 - 00:32
jEdit does not distinguish between the two plus signs on a keyboard.

When I set a shortcut from Utilities> Global Options> Shortcuts, jEdit doesn't want to distinguish between the two plus signs on a keyboard. It sees typing plus sign ("+") using the number pad and a plus sign typing shift with the equals sign ("=") as typing the same key.

This also holds true for the left/right ALT key, left/right CTRL key and the left/right WIN key.

jEdit needs to distinguish between the keys so I can set a shortcut using the number pad plus sign while also leaving the plus sign (next to the backspace on the keyboard) not set to a shortcut.

AutoIt (Windows automation language) distinguishes between the following keys when setting a hotkey or sending text (using HotKeySet() and Send(), respectively):

Plus ("+") keys: {+}, {NUMPADADD}
ALT keys: {LALT}, {RALT}
CTRL keys: {LCTRL}, {RCTRL}
WIN keys: {LWIN}, {RWIN}

Here are the Send Commands and the Resulting Keypress
http://www.autoitscript.com/autoit3/docs/functions/Send.htm


Example using AutoItScript:

HotKeySet('{+}', 'ShowMessageOne')
HotKeySet('{NUMPADADD}', 'ShowMessageTwo')

Func ShowMessageOne()
MsgBox(4096,'','You pressed the plus sign next using SHIFT + PLUS SIGN!')
EndFunc
Func ShowMessageTwo()
MsgBox(4096,'','You pressed the plus sign next using the number pad!')
EndFunc
While 1
Sleep(10)
WEnd

^In the above AutoItScript script, it differentiates between the two plus sign keys.

thanks
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
also...
by homeathouse on Fri, 24/10/2008 - 00:53
the subtract key (near the letter P) and the subtract key on the number pad are registered as the same key.

The AutoItScript equivalent is {NUMPADSUB} versus a literal '-' as in...

;this simulates pressing the subtract key (near the letter P)
Send('-');
; this simulates pressing subtract key on the number pad
Send('{NUMPADSUB}');
 
Two different things
by Robert Schwenn on Fri, 24/10/2008 - 18:03
Hi, I think these are two different things.

1. Keys ALT, CTRL, WIN:
These keys normally are only modifiers for shortcut combinations. jEdit does really not distinguish between left and right versions. Maybe it's a Java limitation?

2. Numpad keys and their counterparts
They normally result in a typed character and when assigning a shortcut they are only distinguished if they were typed in combination with at least ALT or CTRL!
I'm not sure if this is a general Java behavior or intended by jEdit developers. But maybe You can live with that?

Robert
 
making progress
by homeathouse on Sat, 25/10/2008 - 06:49
hi there, thanks for the response.

i don't think it's a java limitation. i found that it does somewhat recognize the difference between the keys. Holding either the ALT or CTRL shows the keycode. Here are the keycodes i found:

_typed on number pad > resulting keycode_
0 > NUMPAD0
1 > NUMPAD1
2 > NUMPAD2
3 > NUMPAD3
4 > NUMPAD4
5 > NUMPAD5
6 > NUMPAD6
7 > NUMPAD7
8 > NUMPAD8
9 > NUMPAD9
. > DECIMAL
+ > ADD
- > SUBTRACT
* > MULTIPLY
/ > DIVIDE
= > EQUALS

I tried to manually edit the properties file holding the shortcuts in "\Documents and Settings\...\.jedit\properties" and restarted jEdit.

about.shortcut=NUMPAD0
^you would think doing this would show the jEdit about screen typing just the zero on the number pad.

I don't want to give up just yet. We're probably just a line of code away. It's in there somewhere.
 
SciTE uses Named IDs and numeric IDs
by homeathouse on Tue, 04/11/2008 - 13:50
SciTE uses Named IDs and numeric IDs.

"Named IDs and numeric IDs below 2000 are SciTE menu commands. The modifiers are Ctrl, Shift, and Alt and the named keys are Left, Right, Up, Down, Insert, End, Home, Enter, Space, Tab, KeypadPlus, KeypadMinus, KeypadMultiply, KeypadDivide, Escape, Delete, PageUp, PageDown, Slash, Question, Equal, Win."

http://www.scintilla.org/SciTEDoc.html

From "C:\Program Files\AutoIt3\SciTE\SciTEGlobal.properties":
# User defined key commands
user.shortcuts=\
KeypadPlus|IDM_EXPAND|\
KeypadMinus|IDM_BLOCK_COMMENT|
 
Keyboard Tester
by homeathouse on Wed, 29/10/2008 - 09:20
Utilities> Troubleshooting> Keyboard Tester

Example for NUMPAD1:
Event KEY_PRESSED,keyCode=0x61,keyChar=0x31,modifiers=0x8,consumed=0 passed
Event KEY_RELEASED,keyCode=0x61,keyChar=0x31,modifiers=0x8,consumed=0 passed
User login
Browse archives
« April 2024  
MoTuWeThFrSaSu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   82348
Context Free Art (*.cfdg)   0.31   46055
JBuilder scheme   .001   18495
BBEdit scheme   1.0   18116
ColdFusion scheme   1.0   18024
R Edit Mode - extensive version   0.1   17473
Advanced HTML edit mode   1.0   16206
Matlab Edit Mode   1.0   16068
jEdit XP icons   1.0   15229
XP icons for jEdit   1.1   14293