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

On-Screen Keyboard

Started by DannySMc, 12 November 2014 - 11:24 AM
DannySMc #1
Posted 12 November 2014 - 12:24 PM
Hello!:
I have recently wanted to make a on screen keyboard, no reason why, just thought it would be cool, until I started to really think about the possibilities… In 2 hours I made a simple table, that will allow you to type, and backspace and more, with F1 to 5 keys that return so can be used for options. A Caps Lock function and others. I wanted to make it because it would be cool to use with monitors, it's ironic how this first update doesn't run on monitors and just on terminal… New ideas or things to add? Tell me!

PLEASE:

Please don't slate it, only shared it with you because it may be useful and I wanted a version out for you lovely people to help test for me! Any bugs PM me!

How To Use:
Simply add the API to your program, or load it as an external one, and just call the inputKeyboard() function with a variable in front to grab the text returned!

Download:
pastebin get 16JAjfUf keyboard

Example:

os.loadAPI("keyboard")
sText = keyboard.inputKeyboard()

NOTE:
Under the keyboard.inputKeyboard() function you will need to redraw the screen, so personally I would use the window API to save the information, run this then redraw the window.

Anyway:

Features:
  • Pretty GUI
  • On-Screen Touch
  • Caps Lock Option
  • Function buttons that return the function number
  • Backspace and Space
  • Saves to a local table, that is emptied.
  • Returns string after!
Images:
The images are attached at the bottom!

Next Update:
  • Monitor Support
  • Custom X and Y positions to draw the keyboard
  • Copy and Paste
H4X0RZ #2
Posted 12 November 2014 - 03:09 PM
This looks awesome!
Great job!
Agent Silence #3
Posted 12 November 2014 - 03:51 PM
You might want to invert the background and text color.

So the keys are white and the background is black
DannySMc #4
Posted 12 November 2014 - 05:01 PM
You might want to invert the background and text color.

So the keys are white and the background is black

Preferred the chosen, will make it configurable!

This looks awesome!
Great job!

Thanks, hopefully will be ready by the end of the week for configs and monitors!