11 posts
Posted 06 January 2013 - 10:18 PM
Hi,
I have a Problem, becousse some Programs which are useing mouse need both mouse-buttons.
So, my Idea was to make Advanced Monitors Unbreakable with the blank hand, so you could use every mouse-click event
Also it would be cool if there was a command like
monitor.enableTouchscreen()
and
monitor.disableTouchscreen()
So, what's your mind to this topic?
Pleease reply.
724 posts
Posted 06 January 2013 - 11:18 PM
Why you need to disable it? Just ignore events.
I'm not sure about both mouse keys. It seems touchscreens should not have it.
2447 posts
Posted 07 January 2013 - 01:02 AM
Not possible I'm afraid. You will have to rewrite the program based on only a touch input.
280 posts
Location
Earth
Posted 11 January 2013 - 04:18 AM
Would it be possible to make a tool (say a stylus) that dose not do damage to any block.
of course realistically real touch screens don't really have left and right click.
7508 posts
Location
Australia
Posted 11 January 2013 - 04:24 AM
Not possible I'm afraid. You will have to rewrite the program based on only a touch input.
Not sure if its been suggested before, but what about a crouch click? would that be 'possible' ?
2447 posts
Posted 11 January 2013 - 08:00 AM
Possible but I don't think it would make any sense.
453 posts
Location
Holland
Posted 11 January 2013 - 08:34 AM
i real life you cant do a right click on a touch screen.
2447 posts
Posted 11 January 2013 - 09:19 AM
i real life you do a right click on a touch screen.
What?
453 posts
Location
Holland
Posted 11 January 2013 - 09:58 AM
changed my post….. lol
7508 posts
Location
Australia
Posted 11 January 2013 - 10:37 AM
Possible but I don't think it would make any sense.
Oh I know it doesn't make any sense… just wanted to see if it was possible ;)/>
264 posts
Location
Where you aren't
Posted 11 January 2013 - 10:38 AM
i real life you do a right click on a touch screen.
What?
In real life you only have one click on a touch screen, meaning you can't right-click.
2447 posts
Posted 11 January 2013 - 10:55 AM
Yeah, after he edited is post it made more sense.
That is the crux of the matter - right clicks just wouldn't make sense on a monitor.
1688 posts
Location
'MURICA
Posted 16 January 2013 - 03:43 AM
Actually, I used to own a touch screen, and you could right click by tapping and holding for about a second. If you wanted to, you could make some sort of wrapper similar to the monitor program that makes it so that if the user taps the screen two or more times within a short time period (right click holding to repeatedly click) it'd register a right click. That would be problematic if you actually meant to touch that part of the screen twice, though.
7508 posts
Location
Australia
Posted 16 January 2013 - 04:04 AM
Actually, I used to own a touch screen, and you could right click by tapping and holding for about a second. If you wanted to, you could make some sort of wrapper similar to the monitor program that makes it so that if the user taps the screen two or more times within a short time period (right click holding to repeatedly click) it'd register a right click. That would be problematic if you actually meant to touch that part of the screen twice, though.
Triple-click maybe? however any variant of this can be done in code and doesn't really need an impl from the mod end…
1054 posts
Posted 16 January 2013 - 11:48 AM
Actually, I used to own a touch screen, and you could right click by tapping and holding for about a second. If you wanted to, you could make some sort of wrapper similar to the monitor program that makes it so that if the user taps the screen two or more times within a short time period (right click holding to repeatedly click) it'd register a right click. That would be problematic if you actually meant to touch that part of the screen twice, though.
Triple-click maybe? however any variant of this can be done in code and doesn't really need an impl from the mod end…
He's referring to the monitor program, so I think he's talking about a Lua side implementation.
7508 posts
Location
Australia
Posted 16 January 2013 - 12:47 PM
He's referring to the monitor program, so I think he's talking about a Lua side implementation.
And what I'm saying is its possible to do it in code anyways… here is an example I just whipped up… it could be improved slightly, but its works, and thats all i wrote it for, to show it can be done…
Spoiler
local timesTouched = 0
local waitingForClicks = false
local waitingPos = {}
os.startTimer(0.4)
while true do
local event = { os.pullEvent() }
if event[1] == "monitor_touch" then
local xPos = event[3]
local yPos = event[4]
timesTouched = timesTouched + 1
if timesTouched < 2 then
waitingForClicks = true
waitingPos = {xPos, yPos}
elseif timesTouched == 2 then
os.queueEvent( "mouse_click", 2, xPos, yPos )
waitingForClicks = false
end
elseif event[1] == "mouse_click" then
print( event[2].." : "..event[3].." : "..event[4] )
elseif event[1] == "timer" then
timesTouched = 0
if waitingForClicks then
os.queueEvent( "mouse_click", 1, waitingPos[1], waitingPos[2] )
end
waitingForClicks = false
os.startTimer(0.4)
end
end
1054 posts
Posted 16 January 2013 - 12:55 PM
He's referring to the monitor program, so I think he's talking about a Lua side implementation.
And what I'm saying is its possible to do it in code anyways… here is an example I just whipped up… it could be improved slightly, but its works, and thats all i wrote it for, to show it can be done…
Spoiler
local timesTouched = 0
local waitingForClicks = false
local waitingPos = {}
os.startTimer(0.4)
while true do
local event = { os.pullEvent() }
if event[1] == "monitor_touch" then
local xPos = event[3]
local yPos = event[4]
timesTouched = timesTouched + 1
if timesTouched < 2 then
waitingForClicks = true
waitingPos = {xPos, yPos}
elseif timesTouched == 2 then
os.queueEvent( "mouse_click", 2, xPos, yPos )
waitingForClicks = false
end
elseif event[1] == "mouse_click" then
print( event[2].." : "..event[3].." : "..event[4] )
elseif event[1] == "timer" then
timesTouched = 0
if waitingForClicks then
os.queueEvent( "mouse_click", 1, waitingPos[1], waitingPos[2] )
end
waitingForClicks = false
os.startTimer(0.4)
end
end
*snip*
Got it. :)/> I just thought it was kind of obvious that it could be done. :P/> It's a simple finite state machine afterall. But you're example is quite nice. :)/> And I got the point. :D/>
7508 posts
Location
Australia
Posted 16 January 2013 - 01:00 PM
Got it. :)/> I just thought it was kind of obvious that it could be done. :P/> It's a simple finite state machine afterall. But you're example is quite nice. :)/> And I got the point. :D/>
Some people might not realise that it can be done, hence me stating it… Thanx :)/>