Author Topic: Edit shortcuts stopped working !  (Read 17185 times)

Offline gul

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Edit shortcuts stopped working !
« Reply #15 on: April 17, 2020, 09:24:43 pm »
Hey thanks again for quick reply,

Yes in settings textboxes everything works properly, only in editor does not.

Also are you able to build the software manually.
I'm not sure what you mean, you want me to try to build CB from source on my machine or?

locale:
Code
LANG=sr_RS
LANGUAGE=sr_RS
LC_CTYPE="sr_RS"
LC_NUMERIC=sr_RS
LC_TIME=sr_RS
LC_COLLATE="sr_RS"
LC_MONETARY=sr_RS
LC_MESSAGES="sr_RS"
LC_PAPER=sr_RS
LC_NAME=sr_RS
LC_ADDRESS=sr_RS
LC_TELEPHONE=sr_RS
LC_MEASUREMENT=sr_RS
LC_IDENTIFICATION=sr_RS
LC_ALL=

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Edit shortcuts stopped working !
« Reply #16 on: April 17, 2020, 09:36:07 pm »
Why are you using non-utf8 locale?

This is a commit which tried to make shortcuts work on non English locales/layout...
https://github.com/obfuscated/codeblocks_sf/commit/e26acf44b8ece212205423e2d57c392dc8ac2ad6
But I guess it doesn't work correctly.

Can you compile the latest wxwidgets master branch? You have to compile and test the samples/stc sample.
It would be interesting to know if shortcuts work there. My guess is that they won't work.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Edit shortcuts stopped working !
« Reply #17 on: April 17, 2020, 09:39:12 pm »
Also do you have scite, geany or something else which is based on scintilla? Does shortcuts work there?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline gul

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Edit shortcuts stopped working !
« Reply #18 on: April 17, 2020, 09:57:08 pm »
I didn't know non-UTF8 locale is a bad thing haha, why is that? I just recently changed it from default ENG.
Funny thing is i still have the problem even if i switch back to ENG locale.

I'll try to compile everything from source but it will take some time,

Ye I have geany it works as it should but its not codeblocks haha.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Edit shortcuts stopped working !
« Reply #19 on: April 17, 2020, 11:40:59 pm »
I guess the locale is not involved in this. But you definitely should use a utf8 locale, but it might be too late (if you have saved files with non-ascii symbols they might be broken if you change the locale). Using non-utf8 locale I think would mean that you either use a the upper half of the 1 byte or multi-byte/fixed size locale. You should read up. But generally programs on linux kind of expect a utf8...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline gul

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Edit shortcuts stopped working !
« Reply #20 on: April 18, 2020, 08:28:24 pm »
Ok, thanks, i changed the locale to UTF8, thankfully i didn't use non ANCII chars in beetween.

Anyway I compiled wxWidgets from git, and stc sample works correctly, i can copy paste etc. there.

After that i built CB from SVN and i still have the problem, but another thing is i ran CB from terminal and it keep printing this message:
Code
The Parser is still parsing files. > Reasons:
- still need to mark files as local

I get the same message on an overlay in editor while i type, dont know if its related.

 

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Edit shortcuts stopped working !
« Reply #21 on: April 18, 2020, 10:45:01 pm »
I don't think the parsing problem is related.

On the original problem:
Interesting. So you don't have the problem in the stc sample...
Can you please put some printfs in the function I've highlighted in CB and do a build?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline gul

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Edit shortcuts stopped working !
« Reply #22 on: April 18, 2020, 10:56:41 pm »
Sorry, what function do you mean exactly?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline gul

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Edit shortcuts stopped working !
« Reply #24 on: April 19, 2020, 12:31:37 am »
Ok, i recomplited it with 4 printfs, it looks to me like the function registers keystrokes corrently, but still nothing happens on screen.

For example this is what i get with CTRL-A:

 
Code
1. KEY: 308  CTRL: 1 
2. KEY: 308  CTRL: 1
4. KEY: 0  CTRL: 1  RV: 0

1. KEY: 1729  CTRL: 1
2. KEY: 1729  CTRL: 1
4. KEY: 1729  CTRL: 1  RV: 0

I used ENG keyboard.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Edit shortcuts stopped working !
« Reply #25 on: April 19, 2020, 12:49:25 am »
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?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline gul

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Edit shortcuts stopped working !
« Reply #26 on: April 19, 2020, 02:05:11 am »
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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Edit shortcuts stopped working !
« Reply #27 on: April 19, 2020, 10:38:55 am »
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

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

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

Can you apply the same patch to wx's stc and print the output?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Edit shortcuts stopped working !
« Reply #28 on: April 19, 2020, 10:55:37 am »
I thought these are keycodes so they don't have to match actual ASCII char values, no?

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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline gul

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Edit shortcuts stopped working !
« Reply #29 on: April 19, 2020, 02:18:40 pm »
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

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