Announcement

Collapse
No announcement yet.

e_Key and e_Modifier error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • e_Key and e_Modifier error

    Ctrl+B successfully bolds the selected paragraph text
    Ctrl+U successfully underlines the selected paragraph text
    however the error I haven't been able to solve this afternoon is that: Ctrl+I replaces the selected text with empty italic characters rather than the selected text.

    Any help for this anomaly is appreciated. Is this a "bug"?



    -- Bold, Underline or Italic selected paragraph text

    if (e_Key == 66 and e_Modifiers.ctrl == true) then
    -- Create a table for the Bold formatting.
    tbFormat = {Bold=true};
    RichText.SetSelectionFormat("RichTextSticky1", tbFormat, true);

    elseif (e_Key == 73 and e_Modifiers.ctrl == true) then
    -- Create a table for the Italic formatting.
    tbFormatt = {Italic=true};
    RichText.SetSelectionFormat("RichTextSticky1", tbFormatt, true);

    elseif (e_Key == 85 and e_Modifiers.ctrl == true) then
    -- Create a table for the Underline formatting.
    tbFormattt = {Underline=true};
    RichText.SetSelectionFormat("RichTextSticky1", tbFormattt, true);

    else


    end
    Classic IT Support
    https://www.classicit.net
    https://www.message7.org

  • #2
    You do have your code on the On Key event of the RichText object, right John? Your code seems to work just fine on my end. Tested with AMS Personal v8.0.5.0 - no problems. Try it with a different AMS version and let us know what happens.

    Comment


    • #3
      Sorry, I'm just the re-reading the first part of your post. What are you trying to do with Ctrl+l? I was assuming you were going for the functions of bold, italic and underline. So where does Ctrl+l fit in? Did you mean Ctrl+i?

      Comment


      • #4
        Ctrl+I or Ctrl+i
        The e_Key for I or i is 73, but in the above scenario, Ctrl+i replaces the selected text by deleting the actual text and inserting italicised blanks in the RichText paragraph.

        If I set the e_Key at 74 (which is the letter J or j) then it works as expected, italicising the selected text in the RichText paragraph. But, as most people are familiar with the keyboard shortcut for Italics being Ctrl+i.



        I will test this scenario out on another machine tonight.
        Classic IT Support
        https://www.classicit.net
        https://www.message7.org

        Comment


        • #5
          Originally posted by John_Klassek View Post
          Ctrl+I or Ctrl+i
          The e_Key for I or i is 73, but in the above scenario, Ctrl+i replaces the selected text by deleting the actual text and inserting italicised blanks in the RichText paragraph.
          Okay, understood John. I'm not seeing any such error on my end.
          I've conducted tests under:
          • AMS Personal Edition v8.0.5.0
          • AMS Personal Edition v8.0.7.0
          • AMS Professional Edition v8.5.0.0
          ... and am unable to replicate your above-described error. Everything is working as it should be (just as these screencaps would indicate):

          On Show (at runtime):




          After Ctrl+B (Bold):




          After Ctrl+I (Italic):




          After Ctrl+U (Underline):




          Have attached the APZ used for testing under AMS Personal v8.0.7.0. And for good measure, have also attached the HDD exe output compiled under v8.0.7.0. At his stage, I'm suspecting either a Windows issue on your end, or perhaps an issue with the particular version of AMS that you're using.

          Awaiting further results via your own testing.

          Attached Files

          Comment


          • #6
            Yes, the same code works fine in your project, but in mine, it fails to properly execute Italics with Ctrl+i (the alternative Ctrl+j works fine, as you'll see in the code).
            Project as attached, as run and compiled in 8.5.3 under Windows 10 Home 64 bit. I've also tested it on another Windows 10 64bit machine, with the same error.

            Any info appreciated that may help understand why this is happening.
            Attached Files
            Classic IT Support
            https://www.classicit.net
            https://www.message7.org

            Comment


            • #7
              The error is occurring when the Read Only feature of the RichText object is unchecked. When the Read Only feature is left checked (ie. in its default state) the error does not occur.

              And yet a quick test via Dialog.Message() indicates that Decimal 73 is correctly being returned via the e_Key event variable, regardless of the state to which the Read Only feature is set. This is indeed a mystery.

              Despite noting the following information provided by the manual:

              Internally the richtext object uses the Rich Edit control available on the user's system. Some advanced runtime features may only be available in certain versions of the control. For a more in-depth discussion of the control, see the topic: MSDN: Rich Edit.
              .. I can see nothing to further elucidate the issue.

              As the error only seems to occur when using Ctrl+i (ie. key-73) and not the other keys, it does indeed appear to be some kind of bug.

              Comment


              • #8
                Thanks BioHazard. Appreciate you testing/looking into this. Indeed you're right - I hadn't considered the Read Only state. I'm wondering whether and how to submit this as a possible bug. Thanks again!
                Classic IT Support
                https://www.classicit.net
                https://www.message7.org

                Comment


                • #9
                  Hey John, could you do a little tutoril on how you set up the EV cert and where you get them, all the old ways I used to do it no longer work.I used to use a open source cert back in the day.

                  Plugins or Sources MokoX
                  BunnyHop 2021 Here

                  Comment

                  Working...
                  X