Author Topic: Virtual Keyboard  (Read 6439 times)

0 Members and 1 Guest are viewing this topic.

Offline NOVARSEG

  • Forum Resident
  • Posts: 509
    • View Profile
Re: Virtual Keyboard
« Reply #15 on: February 08, 2021, 03:05:58 am »
Does this require latest QB64 version and are library files needed?





Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Virtual Keyboard
« Reply #16 on: February 08, 2021, 03:10:21 am »
It should work in v1.4, and all the files are in the 7zip, including a prebuilt EXE just for testing.  All the EXE does is give you key code and ASC symbol of any key you click on, showcase how the buttons work, and it’ll spam the crap out of you if you doubleclick and HOLD the space button.

4 keyboard layouts included in the demo, with the KB# button as the toggle.

ESC — either from physical keyboard or virtual one — exits the demo.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline NOVARSEG

  • Forum Resident
  • Posts: 509
    • View Profile
Re: Virtual Keyboard
« Reply #17 on: February 08, 2021, 03:17:20 am »
i downloaded https://www.qb64.org/forum/index.php?action=dlattach;topic=3608.0;attach=9730
to my qB64 folder and get  ''Keyboard Library.BI'  not found error

Also cant find the 7zip file


Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Virtual Keyboard
« Reply #18 on: February 08, 2021, 03:31:54 am »
i downloaded https://www.qb64.org/forum/index.php?action=dlattach;topic=3608.0;attach=9730
to my qB64 folder and get  ''Keyboard Library.BI'  not found error

Also cant find the 7zip file

It was missing the .7z extension.  You can either just add it onto the version you downloaded, or else delete that one and grab the new one and try it.

When 7z built the archive, it used the .0 in ...v1.0 as the extension, when it should've been ...v1.0.7z, with a .7z extension.  That's been corrected.  Thanks for the report.

Note:  You'll have to extract the contents of the 7z file to make use of them.  ;)
« Last Edit: February 08, 2021, 03:33:02 am by SMcNeill »
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Dav

  • Forum Resident
  • Posts: 792
    • View Profile
Re: Virtual Keyboard
« Reply #19 on: February 08, 2021, 07:44:19 am »
This works great, Steve.  Thanks for taking the time to add all the comments. I'm adding a typewritter click sound just for fun.

Thanks for sharing this.

- Dav

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Virtual Keyboard
« Reply #20 on: February 08, 2021, 09:21:52 am »
I think about the biggest thing that might look non-intuitive to a new user, is the creation of your buttons.

button_type = Register_Button(50, 50, 50, 150, 150, 150, 8, font, &HFFFFFF00, 0)

To break that down for you:

The first 3 numbers are a colors R, G, B values.  It’s what color we start shading with.
The next 3 numbers are a colors R, G, B values.  It’s the central color we end up with.
The next digit is the number of lines we use to produce the shading.

So we start at _RGB(50, 50, 50), and we shade to _RGB(150, 150, 150) in 8 steps, to make the raised “up” buttons.

The next 3 digits are font, font color, and font background color....

Now, as to WHY those are HEX values rather than a whole bunch of RGB parameters again, that’s just my personal style.  We have the option of altering Alpha here as well, and it’s just easier for me to think in terms of &HAARRGGBB than it is to think of alpha,red, green, blue — especially since it’s a non-changing value.

The Red, Green, Blue is separate in the first 3 values just for ease of tweaking and experimenting to find that perfect button shade.  The font color?  MEH!  It’s just going to be a simple primary color, 99.9% of the time, for my needs...

... and besides... Who wants to keep track of a zillion parameters??

Register_Button is : RedStart, BlueStart, GreenStart, RedEnd, BlueEnd, GreenEnd, StepsOfShading, Font, Font color, Font Background Color

Nothing hard to use once you know what all those values stand for, but it’s a little daunting to just stare at blankly.  ;)



And if you have a great sounding click to share, I’ll be happy to add it as an option in the library for an audible reference.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!