User forums > Help
Edit shortcuts stopped working !
oBFusCATed:
What is the value of 'key' passed to KeyDownWithModifiers? For Ctrl-A it should be 'A' or 65...
Can you show me the result of git diff?
gul:
I use mostly pure C and ASM, I'm not very good with Cpp so I don't fully understand what happens in int rv = KeyDownWithModifiers,
but to me it looks like when I press just CTRL i get 308, and A seems to be 1729,
I thought these are keycodes so they don't have to match actual ASCII char values, no?
And in that case shouldn't 65 / 'A' be CTRL-SHIFT-A ?
I used SVN instead of git because I had the files already, hope that's ok.
--- Code: ---Index: ScintillaWX.cpp
===================================================================
--- ScintillaWX.cpp (revision 12064)
+++ ScintillaWX.cpp (working copy)
@@ -1162,8 +1162,12 @@
const int WXK_NONE = 0;
#endif // wxCHECK_VERSION
/* C::B end */
+
+ printf("1. KEY: %d CTRL: %d \n",key,ctrl);
if (ctrl && key >= 1 && key <= 26 && key != WXK_BACK)
key += 'A' - 1;
+
+ printf("2. KEY: %d CTRL: %d \n",key,ctrl);
switch (key) {
case WXK_DOWN: key = SCK_DOWN; break;
@@ -1202,6 +1206,8 @@
case WXK_SHIFT: key = 0; break;
case WXK_MENU: key = SCK_MENU; break;
case WXK_NONE:
+
+ printf("3. KEY: %d CTRL: %d \n",key,ctrl);
#ifdef __WXGTK20__
if (ctrl)
{
@@ -1268,7 +1274,7 @@
),
consumed
);
-
+ printf("4. KEY: %d CTRL: %d RV: %d \n",key,ctrl,rv);
if (key)
return rv;
else
--- End code ---
oBFusCATed:
This is the log from pressing ctrl-shift-a on my machine.
--- Code: ---1. KEY: 308 CTRL: 1
2. KEY: 308 CTRL: 1
4. KEY: 0 CTRL: 1 RV: 0
1. KEY: 306 CTRL: 1
2. KEY: 306 CTRL: 1
4. KEY: 0 CTRL: 1 RV: 0
1. KEY: 65 CTRL: 1
2. KEY: 65 CTRL: 1
4. KEY: 65 CTRL: 1 RV: 0
--- End code ---
And this is ctrl-a
--- Code: ---1. KEY: 308 CTRL: 1
2. KEY: 308 CTRL: 1
4. KEY: 0 CTRL: 1 RV: 0
1. KEY: 65 CTRL: 1
2. KEY: 65 CTRL: 1
4. KEY: 65 CTRL: 1 RV: 0
--- End code ---
This is the output of ctrl-a when I switch to bulgarian layout:
--- Code: ---1. KEY: 308 CTRL: 1
2. KEY: 308 CTRL: 1
4. KEY: 0 CTRL: 1 RV: 0
1. KEY: 0 CTRL: 1
2. KEY: 0 CTRL: 1
3. KEY: 0 CTRL: 1
4. KEY: 65 CTRL: 1 RV: 0
--- End code ---
Can you apply the same patch to wx's stc and print the output?
oBFusCATed:
--- Quote from: gul on April 19, 2020, 02:05:11 am ---I thought these are keycodes so they don't have to match actual ASCII char values, no?
--- End quote ---
See the code after "printf("3. KEY: %d CTRL: %d \n",key,ctrl);"
Its job is to remap the keycode to the ASCII value.
The idea is to try to translate the pressed key to the key code if the same button is pressed on a qwerty English keyboard.
gul:
Haha, ok i found out where the problem is. I have 3 keyboard layouts ENG, SER latin and SER cyrilic.
Now I was sure i tested all 3, but now when i tried again with the cyrilic layout it works !
This is the output.
--- Code: ---1. KEY: 308 CTRL: 1
2. KEY: 308 CTRL: 1
4. KEY: 0 CTRL: 1 RV: 0
1. KEY: 0 CTRL: 1
2. KEY: 0 CTRL: 1
3. KEY: 0 CTRL: 1
4. KEY: 65 CTRL: 1 RV: 0
--- End code ---
The problem is i use mostly ENG keyboard layout especially in CB. From what i see the code to convert the keycode to ASCII only runs in case WXK_NONE: (when the key is 0).
So on my machine it never enters that part of the code, beacuse i get 1729 for A on ENG layout.
I'll try to reset keyboard layout settings to see if that will fix the problem
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version