Jump to content




Mouse event conflicts with pullEventRaw


  • You cannot reply to this topic
5 replies to this topic

#1 latias1290

  • Members
  • 9 posts

Posted 19 January 2014 - 10:10 AM

hello,
I am trying to make a login system for my PC that involves user-friendly looking windows and supports mouse clicks. However, a major security leak in my program causes, whenever someone tries to ctrl+T their way into my PC, raise an error message saying:
startup:65: attempt to compare nil with number
It then terminates, allowing anyone to get in like any other poor-quality lock.
This is very likely due to my program using both
event, button, x, y = os.pullEvent("mouse_click")
to catch mouse clicks, as well as
os.pullEvent = os.pullEventRaw
to stop the program from terminating.
I cant post the full code now, but I might be able to later today.
How can I stop the program from being force-terminated while retaining mouse support?

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 19 January 2014 - 01:47 PM

Post the full code. And you probably don't want to be filtering events anyway if you're trying to make something complex like that.

#3 latias1290

  • Members
  • 9 posts

Posted 19 January 2014 - 01:58 PM

View PostLyqyd, on 19 January 2014 - 01:47 PM, said:

And you probably don't want to be filtering events anyway if you're trying to make something complex like that.
What exactly do you mean by "filtering events"? Because this program is supposed to not have one of the biggest security flaws out there, like any other security program. Also, the mouse clicks are not truly necessary, but I just want to have something snazzy like that :)

#4 CometWolf

  • Members
  • 1,283 posts

Posted 19 January 2014 - 02:07 PM

Filtering events means you're only catching a specific event with your os.pullEvent. That's what the argument("mouse_click") does, now you only get mouse_click events.

#5 latias1290

  • Members
  • 9 posts

Posted 20 January 2014 - 02:13 PM

Well then, is there any way to catch mouse clicks without filtering them?

#6 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 20 January 2014 - 03:04 PM

They come in like any other event, so just os.pullEvent().





3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users