Skip to Content

Can't catch "Ctrl" pressed event with BoModifiersEnum

Hello,

I am trying to catch the "Ctrl + a" pressed event on a system form. I used "BoModifiersEnum" argument to achieve it. However, I can catch that whether "Shift + a" or only "a" is pressed but the same method won't work with "Ctrl" key. It should be working according to description of "BoModifiersEnum" in SDK Help but nothing happens when I pressed the "Ctrl" key. I can only catch "Ctrl" pressed event when I press "Ctrl + Tab".

I can't also catch "Alt" pressed event. Here is the code I wrote;

            if (pVal.Modifiers == SAPbouiCOM.BoModifiersEnum.mt_None)

            {

                Application.SBO_Application.MessageBox("NONE Pressed");

            }

            if (pVal.Modifiers == SAPbouiCOM.BoModifiersEnum.mt_SHIFT)

            {

                Application.SBO_Application.MessageBox("SHIFT Pressed");

            }

            if (pVal.Modifiers == SAPbouiCOM.BoModifiersEnum.mt_CTRL)

            {

                Application.SBO_Application.MessageBox("CTRL Pressed");

            }

            if (pVal.Modifiers == SAPbouiCOM.BoModifiersEnum.mt_ALT)

            {

                Application.SBO_Application.MessageBox("ALT Pressed");

            }

            if (pVal.CharPressed == 65)

            {

                Application.SBO_Application.MessageBox("A Pressed");

            }

Thanks in advance,

Atilla

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Dec 16, 2015 at 02:42 PM

    Hello All,

    I carried this topic to SAP Support and they said that there are limitations to "CTRL" related events.I'll quote their reply.

    "After detailed investigation of this issue, we have found that you can get the event information when CTRL Key is pressed with combination of following windows keys: O, '{', '}', TAB, Enter, Backspace, Home, End, Delete

    You will not be able to get the event information in combination of the rest of the windows key.

    Refer to SAP Note 2240078 describing the same. "

    However. I noticed that you can catch the "Ctrl" pressed event in the Matrix Pressed event. In case you need to check or limit the multi select case on a System MAtrix object you can use "if (pVal.Modifiers == SAPbouiCOM.BoModifiersEnum.mt_CTRL)" code block. Same code also work for ".mt_SHIFT".

    Regards,
    Atilla

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 02, 2015 at 11:02 PM

    AFAIK, the Ctril key only works with TAB and DELETE, as the CTRL key is largely reserved by Windows for its own functions within all Windows apps (ex: CTRL+V for Paste, CTRL + C for Copy, etc.).

    It looks like you're going to need to use a different alternate key other than CTRL, unless I'm wrong of course.

    Add comment
    10|10000 characters needed characters exceeded