This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
CCJJSax's profile picture

Does the Touchpoint API handle computer buttons?

Started by CCJJSax, 12 March 2014 - 07:57 PM
CCJJSax #1
Posted 12 March 2014 - 08:57 PM
I have used it a little bit with monitors, but I'm unsure if it works inside a computer/turtle with no monitor. If it does how do I do it? if not, is there a good api that you suggest that does handle this?
Lyqyd #2
Posted 12 March 2014 - 09:13 PM
The Touchpoint API does not do buttons in terminals, only on monitors. This is due to design decisions in the way button "page" instances are set up and click events are checked. It is also intended to be a well-programmed "drop-in" replacement for the DW20 button API that requires minimal changes to existing programs, to ease users over on to a better API when their use case outgrows the capabilities of the DW20 API.

I've toyed with the idea of creating a slightly more complex version that would incorporate features like console buttons, but haven't gotten around to doing anything about it. I think someone made a small modification to add that feature at one point.
CCJJSax #3
Posted 12 March 2014 - 09:17 PM
I think someone made a small modification to add that feature at one point.

Do you know what it was called by any chance. I tried a few searches, but haven't came up with anything yet.
CCJJSax #4
Posted 12 March 2014 - 09:27 PM
I have found this one. It was updated today too. http://www.computercraft.info/forums2/index.php?/topic/17346-11-button-api/page__hl__%2Badvanced+%2Bcomputer+%2Bbutton__fromsearch__1
Lyqyd #5
Posted 12 March 2014 - 09:27 PM
There was someone on IRC who posted a link to it when he made it. I think it was just for personal use. The basic change to make if you're interested in modifying it is to have .new accept a string (for monitors) or nothing , and change :handleEvents and :run to use mouse_click events if no side name is available and monitor_touch when it is. It's kind of a weird and somewhat more complex usage, which is why I'm generally not wanting to do it as part of the API itself.