how to disable accelerate

View: New views
8 Messages — Rating Filter:   Alert me  

how to disable accelerate

by YangFan-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,all

             I read some source code of Scintilla, and find there is a keymap struct defines some but not all accelerate in keymap.cxx, I want to disable some accelerate not in keymap.cxx defined such as Ctrl+Shift+2/Ctrl+Shift+6 etc. SCI_ASSIGNCMDKEY seems not work, what can I do then? Thanks.

        Regards

 

        YangFan
        missdeer@...
          2007-07-31

_______________________________________________
Scintilla-interest mailing list
Scintilla-interest@...
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Re: how to disable accelerate

by Neil Hodgson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

YangFan:

>              I read some source code of Scintilla, and find there
> is a keymap struct defines some but not all accelerate in
> keymap.cxx, I want to disable some accelerate not in
> keymap.cxx defined such as Ctrl+Shift+2/Ctrl+Shift+6 etc.
> SCI_ASSIGNCMDKEY seems not work, what can I do then?

   If its not in the keymap then its probably being processed by your
application. Another possibility is that you are using a keyboard
layout that has mapped these keys to something recognised by the
keymap. This could occur if you are using a non-English keyboard
layout or a machine (such as a laptop) that has moved functions
around.

   Neil
_______________________________________________
Scintilla-interest mailing list
Scintilla-interest@...
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Re: Re: how to disable accelerate

by YangFan-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, Neil Hodgson

        I read the Scintilla source code, it's not in the keymap, and I'm sure my application do not process these keys. I create simple demos to show Scintilla control, and do nothing else, then the accelerates exist. I have tested on my IBM T43 laptop (Windows XP Pro Sp2 English edition with Chinese language patch) and several Lenovo machines (Windows XP Pro SP2 Chinese edition) with standard 104-keys keyboard, this bug exists. Also, I have tested with MFC and WTL framework on VC 2003, and VCL framework on Borland C++ Builder 6.0, this bug exists. These accelerates do display some strange characters, or move the caret/do backspace etc.

======= 2007-08-01 05:37:02 you said:=======

>YangFan:
>
>>              I read some source code of Scintilla, and find there
>> is a keymap struct defines some but not all accelerate in
>> keymap.cxx, I want to disable some accelerate not in
>> keymap.cxx defined such as Ctrl+Shift+2/Ctrl+Shift+6 etc.
>> SCI_ASSIGNCMDKEY seems not work, what can I do then?
>
>   If its not in the keymap then its probably being processed by your
>application. Another possibility is that you are using a keyboard
>layout that has mapped these keys to something recognised by the
>keymap. This could occur if you are using a non-English keyboard
>layout or a machine (such as a laptop) that has moved functions
>around.
>
>   Neil
>_______________________________________________
>Scintilla-interest mailing list
>Scintilla-interest@...
>http://mailman.lyra.org/mailman/listinfo/scintilla-interest

= = = = = = = = = = = = = = = = = = = =
                       

        Regards

 
                                 
        YangFan
        missdeer@...
          2007-08-01


_______________________________________________
Scintilla-interest mailing list
Scintilla-interest@...
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Re: Re: how to disable accelerate

by Neil Hodgson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

YangFan:

>         I read the Scintilla source code, it's not in the keymap,
> and I'm sure my application do not process these keys. I
> create simple demos to show Scintilla control, and do nothing
> else, then the accelerates exist.

   The keys mentioned do not perform commands for me, instead they
just enter text. Best thing to do now is to run the code under a
debugger with breakpoints in the WM_SYSKEYDOWN / WM_KEYDOWN handling
to see what is happening.

   Neil
_______________________________________________
Scintilla-interest mailing list
Scintilla-interest@...
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Re: Re: Re: how to disable accelerate

by YangFan-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, Neil Hodgson

        I set breakpoint in ScintillaWin.WndProc in the WM_SYSKEYDOWN/WM_KEYDOWN handler, found that every strange accelerate is processed by ::DefWindowProc, but then some one (I don't know who -_-b ) sends a WM_CHAR message to the window. In the WM_CHAR handler, there's a function call iscntrl() to judge if the integer represents a control character, but another more condition lastKeyDownConsumed. I could not understand the usage of variable lastKeyDownConsumed, may I change || to && as shown below ?

        case WM_CHAR:
                if (!iscntrl(wParam&0xff) && !lastKeyDownConsumed) {
                                 ~~~~

                        if (IsUnicodeMode()) {
                                // For a wide character version of the window:
                                //char utfval[4];
                                //wchar_t wcs[2] = {wParam, 0};
                                //unsigned int len = UTF8Length(wcs, 1);
                                //UTF8FromUTF16(wcs, 1, utfval, len);
                                //AddCharUTF(utfval, len);
                                AddCharBytes('\0', LOBYTE(wParam));
                        } else {
                                AddChar(LOBYTE(wParam));
                        }
                }
                return 0;

====== 2007-08-01 08:37:39 you said:=======

>YangFan:
>
>>         I read the Scintilla source code, it's not in the keymap,
>> and I'm sure my application do not process these keys. I
>> create simple demos to show Scintilla control, and do nothing
>> else, then the accelerates exist.
>
>   The keys mentioned do not perform commands for me, instead they
>just enter text. Best thing to do now is to run the code under a
>debugger with breakpoints in the WM_SYSKEYDOWN / WM_KEYDOWN handling
>to see what is happening.
>
>   Neil
>_______________________________________________
>Scintilla-interest mailing list
>Scintilla-interest@...
>http://mailman.lyra.org/mailman/listinfo/scintilla-interest

= = = = = = = = = = = = = = = = = = = =
                       

        Regards

 
                                 
        YangFan
        missdeer@...
          2007-08-01


_______________________________________________
Scintilla-interest mailing list
Scintilla-interest@...
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Re: Re: Re: how to disable accelerate

by Neil Hodgson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

YangFan:

>  ... in the WM_SYSKEYDOWN/WM_KEYDOWN handler, found that
> every strange accelerate is processed by ::DefWindowProc, but then
> some one (I don't know who -_-b ) sends a WM_CHAR message
> to the window.

   They are being sent by Windows. This is normal entry of control
characters, not accelerators. Is your problem the appearance of [NUL],
[BEL], ... when users type these characters? That is normal entry and
display - not caused by accelerators. If you want to disable control
character entry, process them in your application or assign them to
null accelerators.

   Neil
_______________________________________________
Scintilla-interest mailing list
Scintilla-interest@...
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Re: how to disable accelerate

by YangFan-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, Neil Hodgson

            That's my problem. I tested on a simple SDK written program, Windows sends WM_CHARs. But then another problem, I don't know how many control characters are binded to keys, to which keys. Users would feel confused when they press Ctrl+Shift+2 [NUL] appears or Ctrl+Shift+6 [RS] appears etc.

======= 2007-08-02 06:02:17 you said:=======

>YangFan:
>
>>  ... in the WM_SYSKEYDOWN/WM_KEYDOWN handler, found that
>> every strange accelerate is processed by ::DefWindowProc, but then
>> some one (I don't know who -_-b ) sends a WM_CHAR message
>> to the window.
>
>   They are being sent by Windows. This is normal entry of control
>characters, not accelerators. Is your problem the appearance of [NUL],
>[BEL], ... when users type these characters? That is normal entry and
>display - not caused by accelerators. If you want to disable control
>character entry, process them in your application or assign them to
>null accelerators.
>
>   Neil
>_______________________________________________
>Scintilla-interest mailing list
>Scintilla-interest@...
>http://mailman.lyra.org/mailman/listinfo/scintilla-interest

= = = = = = = = = = = = = = = = = = = =
                       

        Regards

 
                                 
        YangFan
        missdeer@...
          2007-08-02


_______________________________________________
Scintilla-interest mailing list
Scintilla-interest@...
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Re: Re: Re: how to disable accelerate

by YangFan-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, Neil Hodgson

        Many thanks, I searched the web, and found a keyboard control character table at http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/rzaiw/rzaiwkeyboard.htm
Hope to some useful for somebody.

======= 2007-08-02 06:02:17 you said:=======

>YangFan:
>
>>  ... in the WM_SYSKEYDOWN/WM_KEYDOWN handler, found that
>> every strange accelerate is processed by ::DefWindowProc, but then
>> some one (I don't know who -_-b ) sends a WM_CHAR message
>> to the window.
>
>   They are being sent by Windows. This is normal entry of control
>characters, not accelerators. Is your problem the appearance of [NUL],
>[BEL], ... when users type these characters? That is normal entry and
>display - not caused by accelerators. If you want to disable control
>character entry, process them in your application or assign them to
>null accelerators.
>
>   Neil
>_______________________________________________
>Scintilla-interest mailing list
>Scintilla-interest@...
>http://mailman.lyra.org/mailman/listinfo/scintilla-interest

= = = = = = = = = = = = = = = = = = = =
                       

        Regards

 
                                 
        YangFan
        missdeer@...
          2007-08-02


_______________________________________________
Scintilla-interest mailing list
Scintilla-interest@...
http://mailman.lyra.org/mailman/listinfo/scintilla-interest