Skip to content

Refactor XR Keyboard layout and UI rendering#156

Open
jolicaD wants to merge 5 commits intogoogle:mainfrom
jolicaD:math_keyboard
Open

Refactor XR Keyboard layout and UI rendering#156
jolicaD wants to merge 5 commits intogoogle:mainfrom
jolicaD:math_keyboard

Conversation

@jolicaD
Copy link

@jolicaD jolicaD commented Feb 9, 2026

Refactor: Keyboard Layout & Rendering Engine

This PR modernizes the virtual keyboard by refactoring the layout logic and improving render stability in XR.

Key Changes

  • Unified Layout Engine: Replaced manual weight calculations with a consolidated addKey method and constant-driven spacing (COL_SPACER, ROW_SPACER).

  • Improved Depth Management: Added a recursive applyZOrder function to ensure all keyboard sub-elements render correctly on top of other world objects.

  • Visual Polish: Switched to a borderless shader and updated the color palette for better legibility.

Screenshot 2026-02-09 at 3 13 19 PM

@google-cla
Copy link

google-cla bot commented Feb 9, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@ruofeidu
Copy link
Collaborator

ruofeidu commented Feb 9, 2026

Thank you Jolica! Would you Gemini solutions to update branch, sign CLA, and pass all prechecks?

Thanks!

@ruofeidu ruofeidu requested review from dli7319 and ruofeidu February 9, 2026 23:35
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove.

this.keyboard = new Keyboard();
this.add(this.keyboard);
this.keyboard.position.set(0, -0.3, 0);
this.keyboard.position.set(0, -0.3, -0.);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems unchanged. Revert?

try {
z = zFunction(x, y);
// Clamp the value to stay between -Z_LIMIT and Z_LIMIT
z = Math.max(-Z_LIMIT, Math.min(Z_LIMIT, z));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xb.clamp(-Z_LIMIT, Z_LIMIT, z)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants