Announcement

Collapse
No announcement yet.

Creating a custom hotkey [need help]

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

  • Creating a custom hotkey [need help]

    Hello everyone i was trying to create a hotkey which is changeable by users,

    example Enter key has a function to show and hide the image. But the user can change the Enter key into other key..

    in the documentation i tried to get the value of each key using Math.Hex but no luck.
    here is my apz sample hoping someone can help, Thanks a lot.






    Attached Files

  • #2
    Here is a little example for you I moved a few things around and seems focus is buggy with key presses one thing I never seen when making my RPG what is based on simuler key press detection, the image was bugging out for me sometimes not setting invistable so I added a little timer to fix that, it's not perfect but I only just woke up and already had a fall out with a house m8, so my bad coding will be down to me blaming that lol

    Hotley.apz

    Reason I helped here is you posted your working outs and what you have already tired, if I see people helping them selves is when I help if I am able or have the time.
    Plugins or Sources MokoX
    BunnyHop Here

    Comment


    • #3
      telco Not sure if this is what you are after or Rex's example

      Hotley.apz
      cheers

      Comment


      • #4
        Hopefully one of these will be what they wanted help with
        Plugins or Sources MokoX
        BunnyHop Here

        Comment


        • #5
          Hello kingzooly thanks for the help i think u nailed my need.. colc thanks also for your response..
          You guys are very helpful.. Merry Christmas cheers

          Comment


          • #6
            I hope you have a nice Christmas also and I am glad I was able to understand anything at that time of morning lol
            Plugins or Sources MokoX
            BunnyHop Here

            Comment


            • #7
              what if i have more than 3 hotkeys and want to change each? how can i check if the given hotkeys was already assigned?

              Comment


              • #8
                telco keycodes are A-Z= 65-90 and a-z=97-122
                you can do an elseif statement

                Code:
                if e_Key == 80 then
                --do something code
                elseif e_Key == 88 then
                --do something code
                elseif if e_Key == 76 then
                --do something code
                else
                --no key found
                end
                Cheers & have a Merry Xmas

                Comment


                • #9
                  Thanks colc.. i will stop for a moment and go to the sofa to celebrate the christmas lol... God Bless... cheers now..

                  Comment


                  • #10
                    Ya like colc, you would just check for that your key you want to use, in the DoKey function you can add more or if you want the hotkey to do something else you could just add it on the on key part it depends on what you want these other hotkeys do, if you are trying to more hidden images then you might have to create the fix for it so you would need to make sure the right timer ID and timers are triggered, but enjoy your xmas and just try and play with it as the best you can, if you get stuck come back with what you have and I sure we will help.
                    Plugins or Sources MokoX
                    BunnyHop Here

                    Comment


                    • #11
                      i have an update now,, i am worried how can the user make changes the Hotkey if they enter the ff: (Enter, Backspace, TAB, alt, capslock and all none character keys)
                      also having trouble including e_Modifiers see the apz
                      Attached Files

                      Comment


                      • #12
                        if e_Key == 13 then
                        Input.SetText(this, "Enter");
                        show = 13;
                        elseif e_Key == 8 then
                        Input.SetText(this, "Backspace");
                        show = 8;

                        elseif e_Key == 8 then
                        Input.SetText(this, "Backspace");
                        show = 8;

                        elseif e_Modifiers.ctrl == true and e_Key ~= nil then
                        Input.SetText(this, "Ctrl+"..e_Key);
                        show = 17+e_Key;
                        Page.SetFocus("");
                        else
                        show = string.byte(string.upper(Input.GetText("Input1"))) ;
                        hide = string.byte(string.upper(Input.GetText("Input2"))) ;
                        end

                        Comment


                        • #13
                          Hi Telco
                          I have inserted keycode function into globals to show how to get your keys and show as text. In apz I have only done the keyboard "F" keys to show you
                          See if you can adapt for your project
                          Hotley_TELCO.apz
                          Cheers

                          Comment


                          • #14
                            nothings happen when i set F1 into F?...

                            Comment


                            • #15
                              ok sorry its on the first input.. anyways will try to implement it how to make 2 keys.. example (control + r) or alt+r..

                              Comment

                              Working...
                              X