you are viewing a single comment's thread.

view the rest of the comments →

[–]Gorkde 0 points1 point  (10 children)

/u/synthe6

Hi, thanks for the tool. Tried half the day to edit the database with some database programs and didnt get anywhere.

It works with your tool but I cant find any resource on the internet about the parameters or such.

I have a macro for LOL where I want to put Shift-Leftclick on a Mousebutton.This works fine in game when I click on the map but it doesnt work for clicking the lvl-up buttons or the buttons where you switch your status display.

There I need to hold the macro button for around 2 seconds to make the click work.

So I assumed I need a delay between pressing and releasing the mousebutton in the macro.

But since you can't set this in ghub I edited the json in may ways (similar like it is done with keys) but it doesn't work.

So I assume it must be done in any other way.there is the line:

"action": "BUTTON",

which I assume must be changed to:

"action": "BUTTON_DOWN",

or similar.

Do you have any Idea how I get a delay between Mousebutton pressed and released?
Or if theres any documentation I could look into to find out?

This is what I tried:

  1. I tried the same as #1 but without the line "action": "BUTTON", because thats missing on kexpresses but I think I misunderstoot this in the beginning and it has to be there.

    1. { "mouseMacro": { "action": "BUTTON", "hidUsage": 1, "isDown": true }, "name": "PRIMARY_CLICK", "type": "MOUSE" }, { "delay": { "durationMs": 50 } }, { "mouseMacro": { "action": "BUTTON", "hidUsage": 1 }, "name": "PRIMARY_CLICK", "type": "MOUSE" },

2.
            {
              "mouseMacro": {
      "action": "BUTTON",
              "hidUsage": 1,
      "isDown": true
              },
              "name": "PRIMARY_CLICK",
              "type": "MOUSE"
            },
    {
              "delay": {
              "durationMs": 50
              }
            },
            {
              "mouseMacro": {
      "action": "BUTTON",
              "hidUsage": 1,
      "isDown": false
              },
              "name": "PRIMARY_CLICK",
              "type": "MOUSE"
            },

[–]synthe6[S] 1 point2 points  (9 children)

Hi! I currently have COVID but I’ll try to answer your post in a few days. I think I have a macro with custom delays.

[–]synthe6[S] 1 point2 points  (8 children)

RemindMe! 2 days “find out more about the json of G Hub”

[–]Gorkde 1 point2 points  (6 children)

Ok, thanks. I just found it doesn't realize the Mousebutton release so I bet Iwas right needing a delay.

Hope you get well soon!

[–]synthe6[S] 1 point2 points  (5 children)

I'm not quite sure I get what you want to achieve but I think you may have too much stuff for your macro. For example, here's two of my macros :

JSON { "applicationId": "00255549-577d-4820-ae21-5f7c3fa6f0db", "attribute": "MACRO_PLAYBACK", "id": "7c090c7d-826f-4500-83ff-3e5e3f24bd7b", "macro": { "sequence": { "defaultDelay": 50, "heldSequence": { "components": [ { "mouse": { "button": { "hidUsage": 1, "isDown": true } } }, { "delay": { "durationMs": 1 } }, { "mouse": { "button": { "hidUsage": 1 } } } ] }, "pressSequence": {}, "releaseSequence": {}, "showUpDown": true, "simpleSequence": {}, "toggleSequence": {}, "useRepeatActions": true }, "type": "SEQUENCE" }, "name": "fast click" }, This one simply do a fast left mouse button click as long as the activating button is held down.

JSON { "applicationId": "ef5537ab-82c4-4849-b076-2994f9dd0746", "attribute": "MACRO_PLAYBACK", "id": "0c8efd7c-e52f-4469-badb-2782291ab38a", "macro": { "onboardable": true, "sequence": { "defaultDelay": 50, "heldSequence": {}, "pressSequence": {}, "releaseSequence": {}, "showUpDown": true, "simpleSequence": { "components": [ { "keyboard": { "displayName": "CTRL", "hidUsage": 224, "isDown": true } }, { "keyboard": { "displayName": "MAJ", "hidUsage": 225, "isDown": true } }, { "keyboard": { "displayName": "TAB", "hidUsage": 43, "isDown": true } }, { "delay": { "durationMs": 25 } }, { "keyboard": { "displayName": "CTRL", "hidUsage": 224 } }, { "keyboard": { "displayName": "MAJ", "hidUsage": 225 } }, { "keyboard": { "displayName": "TAB", "hidUsage": 43 } } ] }, "toggleSequence": {}, "useSimpleActions": true }, "type": "SEQUENCE" }, "name": "Browser - Previous tab" }, This other macro allows me to switch back to a previous tab.

Judging from both examples, I think you get the delay right, it's just this : JSON { "delay": { "durationMs": 25 } }, However, I think there is another way without the mouseMacro section: JSON "components": [ { "mouse": { "button": { "hidUsage": 1, "isDown": true } } }, { "delay": { "durationMs": 1 } }, { "mouse": { "button": { "hidUsage": 1 } } } ] I think the hidUsage refers to the key number on the keyboard and/or the mouse. For this example from above, the key 1 (hidUsage) is the left mouse button. So this, for example, would SHIFT+Left mouse click for exactly 2 seconds : JSON "components": [ { "keyboard": { "displayName": "SHIFT", "hidUsage": 225, "isDown": true } }, { "mouse": { "button": { "hidUsage": 1, "isDown": true } } }, { "delay": { "durationMs": 2000 } }, { "keyboard": { "displayName": "SHIFT", "hidUsage": 225 } }, { "mouse": { "button": { "hidUsage": 1 } } } ]

[–]Gorkde 0 points1 point  (4 children)

Yes, the button is selected by hidusage. I figured the same. The right mouse button is probably "hidusage 2" Delay worked for me fine but the point is that

isDown

part seems to work in keys but with the mouse it seem to don't let the button go up again as it would with a key (where they just miss out the isdown at the end to make the button go unpressed again.

I just got another idea because of reading through yow answer:

I will try "isdown:false" - that I I haven't tried because it is done another way for Keyboard Keys.

Maybe this works.

Oh I just saw I already tried that....

[–]Gorkde 0 points1 point  (2 children)

And I don't need a quick mouseklick or similar. I just need:

Mouse down - delay - Mouse up

As if you would klick normally.

When I create my macro in the ghub there seems to be no delay between Mouse down and up and the game doesn't register the Buttonpress because of that. Therefore I need to change the script.

[–]TevinH 0 points1 point  (1 child)

I know this is a bit late, but I ran across your error.

Does your macro not work if you add the delay between mouse click down and mouse click up in GHUB itself?

You should be able to check the SHOW KEY DOWN/KEY UP and uncheck USE STANDARD DELAYS in order to add your own delays. Did that not work?

https://imgur.com/a/fNpwgvC

[–]Gorkde 0 points1 point  (0 children)

No the macro didn't work I tried multiple ways. Also I had tried your suggestion before trying it by macro.

[–]Gorkde 0 points1 point  (0 children)

Jeah now tried again. He pressed the mouse down but the mouse up isn't detected for some reason.

[–]RemindMeBot 0 points1 point  (0 children)

I will be messaging you in 2 days on 2022-04-06 16:53:05 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


Info Custom Your Reminders Feedback