Code Monkey home page Code Monkey logo

Comments (9)

me2d13 avatar me2d13 commented on September 18, 2024 1

Your script looks ok. You haven't describe what doesn't work, what's the behavior. If lmc_send_keys doesn't work, use more flexible function lmc_send_input. Details are described at http://hidmacros.eu/forum/

from luamacros.

I3ordo avatar I3ordo commented on September 18, 2024

i guess luamacros or hidmacros dont support "up" "down" flags like AHK

from luamacros.

I3ordo avatar I3ordo commented on September 18, 2024

"would like to send "+F13" to be sent """""""only"""""""" when "button 86" i
s """"released"""".
Sorry for the initial typo.
The down vote is for closing the issue
Thanks

from luamacros.

I3ordo avatar I3ordo commented on September 18, 2024

I think the solution if there is one; should be at this line.
"if (button == 86//button up flag here//) then

from luamacros.

me2d13 avatar me2d13 commented on September 18, 2024

You have the direction flag even in your code sample and ignores one direction. The flag is there and is supported. All handling is done in callback function, the initial if is useless (if this is your complete code). You still haven't described what's your current behavior - if you have double press, or no press...
I have nothing to add to my comment when closing this issue

from luamacros.

I3ordo avatar I3ordo commented on September 18, 2024

current behaviour is when i press button "86" it sends the keys "+F13"

i dont want it to send "+F13" on press , just ONLY when i stop pressing "button 86" thus lift my finger off.
i am not familiar with "double press" or "no press" concepts.

so is this the part where i dont understand?
"if (button == 86) then --V
lmc_send_keys('+{F13}', 50)"

and there is a direction part:
"if (direction == 1) then return end"

i dont understand what this part does.

My end code, i guess should seem something like this:

(button == 86) then --Maybe this should be (button == 86down)--
lmc_send_keys('+{F12}', 50)"

(button == 86) then --Maybe this should be (button == 86up)--
lmc_send_keys('+{F13}', 50)

from luamacros.

I3ordo avatar I3ordo commented on September 18, 2024

found this:
lmc_set_handler('MACROS',function(button, direction)
if (direction == 1) then return end -- ignore keydown

if	(button == 67) then lmc_spawn("cmd") -- Keycode for C
elseif	(button == string.byte('C') then lmc_spawn("cmd") -- Via String Byte
    else    print('Pressed button number ' .. button)
end

end)

so basically my code already just works on key up/ ignoring key down

so that s why you could not understand my aim as my code was already doing the thign i want. But my problem persists as i have to isolate that behaviour or it has to ignore "keydown" for some keys , not whole.

from luamacros.

me2d13 avatar me2d13 commented on September 18, 2024

direction contains 1 for key press and 0 for release. All you need to do is combine conditions (direction and button).
As stated - you can't use luamacros without scripting knowledge.

from luamacros.

I3ordo avatar I3ordo commented on September 18, 2024

can you give me a two-line example where button does work on press and other on release or let me try first, it wont work because i dont know how i add direction.

lmc_set_handler('OBSDeck', function(button,direction)
if (direction == 1) then return end

if (button == 86) then --how do i define press or release on "(button==86)"
lmc_send_keys('+{F13}', 50)
if (button == 86) then
lmc_send_keys('+{F14}', 50)
end
end
)

from luamacros.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.