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

Shatter! The new overlay glasses terminal experience

Started by hugeblank, 28 July 2018 - 06:22 PM
hugeblank #1
Posted 28 July 2018 - 08:22 PM
Shatter your dull Overlay Glasses experience by turning it into a redirectable terminal target!


Introducing Shatter!


Shatter converts the sometimes odd to use Plethora Peripheral's overlay glasses into a familiar and cozy terminal environment!

It's as simple as downloading, configuring, and redirecting!


Download: https://github.com/hugeblank/Shatter
Configure: https://github.com/h...aster/README.md
Redirect: http://www.computerc...i/Term.redirect






Okay, so maybe you didn't read the Readme and don't know what's in this bundle of joy I'm calling Shatter. Here's what you're getting into/what you should know:



Wireless Keyboard to Neural Interface Magic

In case you weren't aware like I was when I made server/client software to transmit keystrokes from a computer to a neural interface using a regular computer and SMT, you can use an unbound keyboard to input keystrokes into your neural interface. Is it amazing? Yes. Should I have checked the documentation? Also yes. Is it ironic that I mention the documentation of this project twice in this forum post yet fail to read plethora's? Again, Yes.

A Freaking Mouse

This used to be here:

SpoilerBy strapping on an Entity Sensor and Introspection module, you can enable the use of a cute little green cursor that moves around where you look, and clicks when you shift (and drags when you shift and look around). This is useful because it's not a 'wireless keyboard & mouse' like we all want it to be. The next best option is a little green dot, and it isn't half bad to use.

Fortunately for me even if I did read the documentation I wouldn't have known that the wireless keyboard actually does emit events like a mouse. For once something isn't my fault!


The Terminal Itself (I mean, duh.)

By using a couple of API calls you get the single greatest terminal window available, what could be greater!? I mean seriously what are you still doing here check it out already!


<images to come, thanks for your patience>

<Oh and if you would like to submit your own images they'd be much appreciated, I would love to see what can be done with this :)/> (DM @hugeblank#4114 on discord with what you can snap)>
Edited on 01 August 2018 - 11:14 PM
SquidDev #2
Posted 28 July 2018 - 09:44 PM
Of course you can't inherently bind a wireless keyboard to a neural interface
You sure about that?

A Freaking Mouse
While not documented*, the keyboard will fire "glasses_*" equivalents of mouse events when used with the neural interface and overlay glasses. The coordinates correspond with that of the glasses, so it should be pretty easy to map back to mouse events.

In all seriousness though, this does look a jolly cool project! Nice to see people using the glasses for these sorts of things :)/>.

* Help in documenting things is always appreciated! Not that people read it apparently :P/>.
Edited on 28 July 2018 - 07:46 PM
hugeblank #3
Posted 29 July 2018 - 07:51 PM
Of course you can't inherently bind a wireless keyboard to a neural interface
You sure about that?
Facepalming IRL to something I do digitally isn't something that happens very often. Squid you have made me facepalm IRL, congratulations

A Freaking Mouse
While not documented*, the keyboard will fire "glasses_*" equivalents of mouse events when used with the neural interface and overlay glasses. The coordinates correspond with that of the glasses, so it should be pretty easy to map back to mouse events.
Well this too is awesome! Really glad that I don't have to bodge something together and everything is inbuilt :D/>

* Help in documenting things is always appreciated! Not that people read it apparently :P/>.
Gah! I'm a fool!

And thank you! I love the concept of the overlay glasses, could lead to some really powerful developments in-game as could most of the peripherals in plethora :P/>
Edited on 29 July 2018 - 05:58 PM
Quartz101 #4
Posted 29 July 2018 - 08:31 PM
Finally glad to see something using SMT
osmarks #5
Posted 30 July 2018 - 09:30 AM
Finally glad to see something using SMT
Technically, it only uses it for a bit of the program which isn't actually necessary (keyboard/mouse client - you no longer need it).
hugeblank #6
Posted 31 July 2018 - 05:38 AM
Finally glad to see something using SMT
Technically, it only uses it for a bit of the program which isn't actually necessary (keyboard/mouse client - you no longer need it).

Yeah XP found that it wasn't needed. But anyways, it's worth keeping mentioned in here because it was a large part of the development process of shatter. And for the record it was one of the most easy and workable modem exchange API I have ever used. I plan on using it for a potential project in the future.
hugeblank #7
Posted 31 July 2018 - 05:58 AM
In other news I thought I'd bump an update on the status of shatter here:
What's New

- drastically changed handle function:
- removed cursor re-positioning thread
- removed unnecessary mouse related threads
- added "glasses_" to "mouse_" event conversion thread
- removed keyboard server/client program as they were unnecessary
- removed checks for Entity Sensors and Introspection Modules
- renamed all "glass_" events to "shatter_"
- added setTextScale. Input any value between 0.5 and 10 and the scale will be resized accordingly
- reworked rendering to account for changes in text scale
- added the "shatter_resize" event, triggered when the shatter terminal gets resized

Enjoy! :D/>
hugeblank #8
Posted 02 August 2018 - 01:04 AM
Update Time!

- Cleaned up bad code, squashed minor bugs, lubricated gears, etc.
- Fixed an issue that allowed for one single color to be rendered as multiple through the use of setPaletteColor. In exchange for this issue, set/get|Text/Background|Hex has been added so all 16.8 million colors of the overlay glasses may be utilized.
- By request of one of the users of shatter, the way alpha values function have been fundamentally changed. set/get|Alpha have been removed, in replacement of set/get|Text/Background|Alpha. 'What is the difference?' I hear you ask: the old alpha code was structured per color, meaning that one of the 16 colors was bound to a specific alpha value, meaning that if you wanted to use black text over a black background that was partially transparent, it wouldn't look all that great. Now not only are alpha values not bound to a color, they aren't bound to both text and background, increasing functionality in your favor!

Huzzah! Shatter is becoming better and better by the day! If you haven't tried it out, what are you doing!