Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
KeyBoard Library (for QB64PE v 4.4.0 up)
#1
This is basically Windows Only.  You can plug it into your Linux/Mac systems, but it simply defaults back to _KEYHIT and does nothing else for you guys.

Keyboard Input Enhancement Library

High‑Precision, Fully Remappable, International‑Ready Keyboard Control for QB64

The Keyboard Input Enhancement Library is a complete replacement for QB64’s built‑in keyboard handling. It delivers a modern, event‑driven input system with full modifier awareness, customizable key mappings, international layout support, and an advanced text‑entry engine. Whether you’re building a game, a text editor, a form system, or a multilingual application, this library gives you precise, reliable control over every key on the keyboard.

At its core, the library captures raw key states directly from the operating system and translates them into a flexible mapping table covering all 254 physical key indices. Each key can return different values depending on Shift, Ctrl, Alt, AltGr, or any combination of modifiers. Developers can freely redefine how any key behaves, making it easy to support custom layouts, shortcut systems, or specialized input schemes.

The library includes a robust initialization system that loads a complete default US keyboard layout and optionally applies German, Western European, or Italian remaps. Every key’s unmodified, shifted, controlled, alt‑modified, and AltGr‑modified values can be overridden, along with extended combinations like Ctrl+Alt+Shift or Shift+AltGr.

For real‑time input, the library provides two essential tools:
• KeyHit — an event‑based function that reports key presses, releases, repeats, and modifier states
• KeyDown — a polling function that reports whether a mapped key is currently held

Together, they offer the responsiveness and precision needed for games, editors, and interactive applications.

For text entry, the library includes a fully interactive input engine that behaves more like a lightweight editor than a traditional INPUT statement. It supports cursor movement, backspace, delete, undo, paste, password masking, numeric validation, length limits, screen positioning, and ALT‑code entry. This system is available both as a SUB (writing into a variable) and as a FUNCTION (returning the final string directly).

AltGr support is fully customizable, allowing developers to define which key or key combination should act as AltGr. This is essential for international keyboards and applications requiring third‑level characters.

Overall, the Keyboard Input Enhancement Library transforms QB64’s keyboard handling into a powerful, flexible, and highly configurable system suitable for modern software. It gives developers complete control over key behavior, modifier logic, and text input, enabling richer interfaces and more professional user experiences.


Attached Files
.7z   Keyboard Library.7z (Size: 18.6 KB / Downloads: 8)
Reply


Messages In This Thread
KeyBoard Library (for QB64PE v 4.4.0 up) - by SMcNeill - 05-09-2025, 05:14 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Draw Library (for QB64PE v4.4 up) SMcNeill 5 789 02-12-2026, 01:54 AM
Last Post: madscijr
  Input Devices Library SMcNeill 2 164 02-01-2026, 10:36 PM
Last Post: SMcNeill
  Date Library (v 4.4.0 up) SMcNeill 4 251 02-01-2026, 09:37 PM
Last Post: SMcNeill
  Screen Library SMcNeill 0 574 05-09-2025, 02:41 PM
Last Post: SMcNeill
  Text to Speech Library (Windows only) SMcNeill 11 4,027 07-01-2023, 07:58 PM
Last Post: mnrvovrfc

Forum Jump:


Users browsing this thread: 1 Guest(s)