Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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

Tags:
Former Member
Former Member replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question