Skip to content

armgit / soju

Public Imported from GitHub
0

Play Windows games on Apple Silicon Macs. Free, open-source app that installs the official Battle.net, Steam, Epic and GOG launchers and lists your games in one library.

43.5 KB
Raw Blame
diff --git a/steamvr/CMakeLists.txt b/steamvr/CMakeLists.txt
index f524503..7793bac 100644
--- a/steamvr/CMakeLists.txt
+++ b/steamvr/CMakeLists.txt
@@ -5,7 +5,7 @@ option(D2RVR_DEVELOPER "Enable developer diagnostics" OFF)
 set(CMAKE_CXX_SCAN_FOR_MODULES OFF)
 # Linux needs a case adapter for SDK includes of Windows.h. On Windows the
 # adapter would resolve its own windows.h include and hide the real SDK header.
-if(NOT CMAKE_HOST_WIN32)
+if(NOT CMAKE_HOST_WIN32 AND NOT CMAKE_HOST_APPLE)
   include_directories(${CMAKE_CURRENT_SOURCE_DIR}/compat)
 endif()
 set(CMAKE_CXX_STANDARD 20)
@@ -272,6 +272,8 @@ target_link_libraries(interaction-test PRIVATE framevr-runtime)
 
 add_executable(journal-test journal_test.cpp)
 add_executable(native-panels-test native_panels_test.cpp)
+add_executable(frontend-controls-test frontend_controls_test.cpp)
+add_test(NAME frontend-controls-test COMMAND frontend-controls-test)
 add_executable(dropped-bottles-test dropped_bottles_test.cpp dropped_bottles.cpp)
 target_link_libraries(dropped-bottles-test PRIVATE box3d framevr-runtime)
 add_executable(props-test props_test.cpp)
diff --git a/steamvr/composition_layers.h b/steamvr/composition_layers.h
index e074e34..303e64a 100644
--- a/steamvr/composition_layers.h
+++ b/steamvr/composition_layers.h
@@ -2,6 +2,22 @@
 #include <openxr/openxr.h>
 
 namespace framevr::composition {
+// Some streaming runtimes need a projection source before they can composite
+// quads. A black texel supplies an opaque background without flattening the
+// menu: the following quads retain their world-space pose and stereo depth.
+inline void BlackBackdrop(XrCompositionLayerProjection& layer,
+                          XrCompositionLayerProjectionView (&eyes)[2],
+                          const XrView* views,XrSpace space,XrSwapchain atlas,
+                          XrOffset2Di blackTexel) {
+    layer={XR_TYPE_COMPOSITION_LAYER_PROJECTION};layer.space=space;
+    layer.viewCount=2;layer.views=eyes;
+    for(int i=0;i<2;++i) {
+        eyes[i]={XR_TYPE_COMPOSITION_LAYER_PROJECTION_VIEW};
+        eyes[i].pose=views[i].pose;eyes[i].fov=views[i].fov;
+        eyes[i].subImage.swapchain=atlas;
+        eyes[i].subImage.imageRect={blackTexel,{1,1}};
+    }
+}
 // Proton Experimental's win64 layer-array converter (observed 2026-10-09)
 // sizes EVERY output element from input[0]->type. Projection is 48 bytes;
 // quad is 112. A projection followed by quads therefore overlaps outputs.
diff --git a/steamvr/composition_layers_test.cpp b/steamvr/composition_layers_test.cpp
index a95d936..1a25c41 100644
--- a/steamvr/composition_layers_test.cpp
+++ b/steamvr/composition_layers_test.cpp
@@ -39,5 +39,16 @@ int main(){
     Check(!PrependQuadPadding(layers.data(),count,layers.size(),padding,space,atlas),"capacity respected");
     count=1;layers[0]=base;
     Check(!PrependQuadPadding(layers.data(),count,layers.size(),padding,space,atlas)&&count==1,"scene-only frame adds nothing");
+    XrView views[2]{{XR_TYPE_VIEW},{XR_TYPE_VIEW}};
+    views[0].pose.orientation.w=views[1].pose.orientation.w=1;
+    views[0].pose.position.x=-.032f;views[1].pose.position.x=.032f;
+    views[0].fov=views[1].fov={-.8f,.8f,.8f,-.8f};
+    XrCompositionLayerProjection backdrop{};XrCompositionLayerProjectionView backdropEyes[2]{};
+    BlackBackdrop(backdrop,backdropEyes,views,space,atlas,{1032,32});
+    Check(backdrop.viewCount==2&&backdrop.space==space&&backdrop.layerFlags==0,"opaque stereo backdrop");
+    Check(backdropEyes[0].pose.position.x<0&&backdropEyes[1].pose.position.x>0,"background keeps tracked stereo poses");
+    Check(backdropEyes[0].subImage.imageRect.extent.width==1&&backdropEyes[1].subImage.imageRect.offset.y==32,"background reads only reserved black texel");
+    count=2;layers[0]=reinterpret_cast<const XrCompositionLayerBaseHeader*>(&backdrop);layers[1]=reinterpret_cast<const XrCompositionLayerBaseHeader*>(&menu);
+    Check(PrependQuadPadding(layers.data(),count,layers.size(),padding,space,atlas)&&SurvivesBridge(layers.data(),count),"menu backdrop survives mixed-layer bridge");
     std::puts("Composition: reproduced Wine quad overlap; padding preserves fields, order, capacity and native path");
 }
diff --git a/steamvr/frontend_controls.h b/steamvr/frontend_controls.h
new file mode 100644
index 0000000..f716007
--- /dev/null
+++ b/steamvr/frontend_controls.h
@@ -0,0 +1,52 @@
+#pragma once
+#include "menu_controls.h"
+
+namespace framevr::frontend {
+constexpr int Width=960,Height=360;
+constexpr unsigned NameKeyMessage=0x8000+0x3a1;
+// Native screen values are published by the UI-message listener. Name input
+// uses the game's focused text box, so validation and physical typing stay native.
+struct Output {menus::Pad pad;char text=0;bool erase=false,back=false;};
+struct Controls {
+    int screen=0,selected=0,direction=0;
+    uint16_t held=0xffff,blocked=0;
+    uint64_t repeatAt=0;
+    bool upper=false;
+    bool Visible() const{return screen==1||screen==3;}
+    Output Step(int next,menus::Pad pad,uint64_t now) {
+        if(next!=screen){screen=next;selected=0;direction=0;repeatAt=0;held=pad.buttons;blocked=pad.buttons;}
+        blocked&=pad.buttons;pad.buttons&=~blocked;
+        const auto pressed=uint16_t(pad.buttons&~held);held=pad.buttons;
+        Output out{pad};
+        if(!Visible())return out;
+        const int dx=pad.lx>16000?1:pad.lx<-16000?-1:0;
+        const int dy=screen==3?(pad.ly>16000?-10:pad.ly<-16000?10:0):0;
+        const int move=dx?dx:dy;
+        if(move&&(move!=direction||now>=repeatAt)) {
+            selected=screen==1?std::clamp(selected+move,0,1):(selected+move+30)%30;
+            repeatAt=now+(move!=direction?400:140);
+        }
+        direction=move;
+        out.pad.lx=0;
+        if(screen==1) {
+            out.back=(pressed&menus::B)!=0;out.pad.buttons&=~menus::B;
+            if(selected==1&&(pad.buttons&menus::A)){out.pad.buttons&=~menus::A;out.pad.buttons|=menus::Start;}
+            return out;
+        }
+        out.pad={};
+        if(pressed&menus::B){out.pad.buttons=menus::B;return out;}
+        if(pressed&menus::Y)upper=!upper;
+        if(pressed&menus::X)out.erase=true;
+        if(pressed&menus::A) {
+            if(selected<26)out.text=char((upper?'A':'a')+selected);
+            else if(selected<28)out.text=selected==26?'-':'_';
+            else if(selected==28)out.erase=true;
+            else out.pad.buttons=menus::A;
+        }
+        // Native buttons need a sampled hold, not a one-frame pulse.
+        if((held&menus::B))out.pad.buttons=menus::B;
+        if(selected==29&&(held&menus::A))out.pad.buttons=menus::A;
+        return out;
+    }
+};
+}
diff --git a/steamvr/frontend_controls_art.h b/steamvr/frontend_controls_art.h
new file mode 100644
index 0000000..61c9dd9
--- /dev/null
+++ b/steamvr/frontend_controls_art.h
@@ -0,0 +1,35 @@
+#pragma once
+#include <windows.h>
+#include <vector>
+#include "frontend_controls.h"
+namespace framevr::frontend {
+inline std::vector<uint8_t> Paint(const Controls& model) {
+    std::vector<uint8_t> rgba(size_t(Width)*Height*4);
+    BITMAPINFO info{};info.bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
+    info.bmiHeader.biWidth=Width;info.bmiHeader.biHeight=-Height;info.bmiHeader.biPlanes=1;info.bmiHeader.biBitCount=32;
+    HDC dc=CreateCompatibleDC(nullptr);void* bits=nullptr;
+    HBITMAP bitmap=dc?CreateDIBSection(dc,&info,DIB_RGB_COLORS,&bits,nullptr,0):nullptr;
+    if(!dc||!bitmap||!bits){if(bitmap)DeleteObject(bitmap);if(dc)DeleteDC(dc);return {};}
+    const auto old=SelectObject(dc,bitmap);
+    auto fill=[&](RECT r,COLORREF c){auto b=CreateSolidBrush(c);FillRect(dc,&r,b);DeleteObject(b);};
+    fill({0,0,Width,Height},RGB(18,16,14));
+    auto font=CreateFontW(28,0,0,0,FW_SEMIBOLD,FALSE,FALSE,FALSE,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,
+        CLIP_DEFAULT_PRECIS,ANTIALIASED_QUALITY,DEFAULT_PITCH,L"Segoe UI");
+    const auto oldFont=SelectObject(dc,font);SetBkMode(dc,TRANSPARENT);SetTextColor(dc,RGB(245,235,210));
+    auto text=[&](const wchar_t* t,RECT r){DrawTextW(dc,t,-1,&r,DT_CENTER|DT_VCENTER|DT_SINGLELINE|DT_NOPREFIX);};
+    text(model.screen==1?L"CHARACTERS   |   A: select   B: back":L"CHARACTER NAME",{12,4,Width-12,48});
+    text(model.screen==1?L"Stick left/right: Play / New   |   Up/down: character":L"Stick: move   A: type   X: erase   Y: case   B: back",{12,Height-52,Width-12,Height-8});
+    const int count=model.screen==1?2:30;
+    for(int i=0;i<count;++i){
+        RECT r=model.screen==1?RECT{40+i*460,85,460+i*460,255}:RECT{18+(i%10)*93,58+(i/10)*78,105+(i%10)*93,128+(i/10)*78};
+        fill(r,i==model.selected?RGB(150,107,42):RGB(48,43,36));
+        wchar_t letter[2]={wchar_t((model.upper?'A':'a')+i),0};
+        const wchar_t* label=model.screen==1?(i?L"New":L"Play"):i<26?letter:i==26?L"-":i==27?L"_":i==28?L"Erase":L"Create";
+        text(label,r);
+    }
+    GdiFlush();const auto* bgra=static_cast<const uint8_t*>(bits);
+    for(size_t i=0;i<rgba.size();i+=4){rgba[i]=bgra[i+2];rgba[i+1]=bgra[i+1];rgba[i+2]=bgra[i];rgba[i+3]=255;}
+    SelectObject(dc,oldFont);DeleteObject(font);SelectObject(dc,old);DeleteObject(bitmap);DeleteDC(dc);
+    return rgba;
+}
+}
diff --git a/steamvr/frontend_controls_test.cpp b/steamvr/frontend_controls_test.cpp
new file mode 100644
index 0000000..185d196
--- /dev/null
+++ b/steamvr/frontend_controls_test.cpp
@@ -0,0 +1,28 @@
+#include "frontend_controls.h"
+#include <cassert>
+#include <cstdio>
+using namespace framevr;
+int main(){
+    frontend::Controls c;menus::Pad p;
+    c.Step(1,p,0);p.lx=25000;c.Step(1,p,1);assert(c.selected==1);
+    p={};p.buttons=menus::A;assert(c.Step(1,p,2).pad.buttons==menus::Start);
+    assert(!c.Step(2,p,3).pad.buttons);auto out=c.Step(3,p,4);assert(!out.text&&!out.pad.buttons);
+    p={};c.Step(3,p,5);p.buttons=menus::A;assert(c.Step(3,p,6).text=='a');
+    assert(!c.Step(3,p,7).text);p={};c.Step(3,p,8);
+    p.lx=-25000;c.Step(3,p,9);assert(c.selected==29);
+    c.Step(3,p,10);assert(c.selected==29);
+    c.Step(3,p,409);assert(c.selected==28);
+    p={};p.buttons=menus::A;assert(c.Step(3,p,410).erase);
+    p={};c.Step(3,p,411);p.buttons=menus::B;assert(c.Step(3,p,412).pad.buttons==menus::B);
+    assert(c.Step(3,p,413).pad.buttons==menus::B);
+    c.Step(0,p,414);assert(!c.Visible());
+    c.Step(3,{},415);p={};p.buttons=menus::Y;c.Step(3,p,416);
+    c.Step(3,{},417);p.buttons=menus::A;assert(c.Step(3,p,418).text=='A');
+    c.Step(1,{},500);p={};p.buttons=menus::B;
+    out=c.Step(1,p,501);assert(out.back&&!out.pad.buttons);
+    assert(!c.Step(1,p,502).back);
+    assert(!c.Step(0,p,503).pad.buttons); // no held B in confirmation
+    c.Step(0,{},504);assert(c.Step(0,p,505).pad.buttons==menus::B);
+    assert(!c.Step(1,p,506).back); // closing confirmation cannot reopen it
+    puts("Front-end navigation and name keyboard passed");
+}
diff --git a/steamvr/menu_controls.h b/steamvr/menu_controls.h
index 65285d6..0e10b9e 100644
--- a/steamvr/menu_controls.h
+++ b/steamvr/menu_controls.h
@@ -21,6 +21,27 @@ inline bool Tagged(uint32_t tag){return tag==uint32_t(Mode::World)||tag==uint32_
 inline bool Allowed(uint32_t tag,uint32_t epoch,uint32_t current,bool native,bool settings) {
     return epoch==current&&!settings&&tag==uint32_t(native?Mode::Native:Mode::World);
 }
+// Front-end XInput does not require desktop focus (the simulator owns its keys).
+// Gameplay menus and injected mouse input still require the game window's focus.
+inline bool NavigationActive(bool uiActive,bool focused,bool frontend) {
+    return uiActive&&(focused||frontend);
+}
+// Wine's title panel accepts window key messages but can ignore native pad
+// events before its controller UI exists. Consume one fresh accept through the
+// transition so a held title press cannot also enter the selected character.
+class TitleAccept {
+    bool down=true,consumed=false;
+public:
+    bool Step(bool active,bool title,Pad& pad) {
+        const bool pressed=(pad.buttons&(A|Start))!=0;
+        const bool fire=active&&title&&pressed&&!down;
+        if(!pressed)consumed=false;
+        if(fire)consumed=true;
+        down=pressed||!active;
+        if(consumed)pad.buttons&=~(A|Start);
+        return fire;
+    }
+};
 inline bool Tilted(int16_t x,int16_t y){return std::max(std::abs(int(x)),std::abs(int(y)))>8000;}
 inline bool Busy(const Pad& p){return p.buttons||p.lt>25||p.rt>25||Tilted(p.lx,p.ly)||Tilted(p.rx,p.ry);}
 inline bool SettingsChord(const Pad& p,bool quickCastConsumed) {
diff --git a/steamvr/native_panels_test.cpp b/steamvr/native_panels_test.cpp
index b55d252..46f4177 100644
--- a/steamvr/native_panels_test.cpp
+++ b/steamvr/native_panels_test.cpp
@@ -2,6 +2,7 @@
 #include "npc_dialogue.h"
 #include "panel_input_mode.h"
 #include "menu_controls.h"
+#include "pad_mirror_policy.h"
 #include "quick_cast.h"
 #include "journal.h"
 #include "input.h"
@@ -11,6 +12,54 @@
 using namespace framevr;
 static void Check(bool ok,const char* message){if(!ok){std::fprintf(stderr,"FAIL: %s\n",message);std::exit(1);}}
 int main(){
+    BWPadMirror source{};source.version=BW_PAD_MIRROR_VERSION;source.writer_pid=42;
+    source.counter=123;source.reserved[0]=uint32_t(menus::Mode::Native);source.reserved[1]=7;
+    source.buttons=menus::A;source.left_trigger=200;source.right_trigger=255;
+    source.thumb_lx=12000;source.thumb_ly=-15000;source.thumb_rx=22000;source.thumb_ry=-24000;
+    BWPadMirror copied{};
+    Check(menus::CopyMirror(source,true,42,copied)&&copied.buttons==menus::A,"fresh mirror preserves input");
+    Check(menus::CopyMirror(source,false,42,copied),"internal pad stays connected through loading");
+    Check(!copied.buttons&&!copied.left_trigger&&!copied.right_trigger&&!copied.thumb_lx&&!copied.thumb_ly&&!copied.thumb_rx&&!copied.thumb_ry,"loading releases every control");
+    Check(copied.counter==123&&copied.reserved[1]==7,"neutral mirror retains packet and epoch");
+    Check(!menus::CopyMirror(source,false,99,copied),"stale external pad disconnects");
+    Check(menus::CopyMirror(source,true,99,copied),"fresh external pad remains supported");
+    source.reserved[0]=0;
+    Check(!menus::CopyMirror(source,false,42,copied),"untagged writer retains timeout");
+    source.version=0;
+    Check(!menus::CopyMirror(source,true,42,copied),"unknown mirror version rejected");
+    menus::TitleAccept titleAccept;
+    menus::Pad accept;accept.buttons=menus::A;
+    Check(!titleAccept.Step(true,true,accept),"held input on attachment cannot skip title");
+    menus::Pad released;
+    titleAccept.Step(true,true,released);
+    Check(titleAccept.Step(true,true,accept)&&accept.buttons==0,"fresh title A becomes one window accept");
+    accept.buttons=menus::A;
+    Check(!titleAccept.Step(true,false,accept)&&accept.buttons==0,"held title A cannot play selected character");
+    titleAccept.Step(true,false,released);accept.buttons=menus::A;
+    Check(!titleAccept.Step(true,false,accept)&&accept.buttons==menus::A,"next A uses native character selection");
+    titleAccept.Step(false,true,released);accept.buttons=menus::Start;
+    Check(!titleAccept.Step(false,true,accept),"inactive VR cannot post a title key");
+
+    // Simulator owns desktop focus while the anchored title/class picker consumes XInput.
+    for(bool focused:{false,true})for(bool frontend:{false,true})for(bool placed:{false,true}) {
+        menus::Navigation nav;
+        menus::Pad stick;stick.lx=24000;
+        const bool active=menus::NavigationActive(placed,focused,frontend);
+        Check(active==(placed&&(focused||frontend)),"front-end navigation focus policy");
+        auto report=nav.Step(active,stick,false,0,0,false);
+        Check((report.lx==24000)==active,"only anchored front-end pad bypasses desktop focus");
+        menus::Pad accept;accept.buttons=menus::A;
+        report=nav.Step(active,accept,false,0,0,false);
+        Check(bool(report.buttons&menus::A)==active,"class selection A reaches native UI without a laser hit");
+        report=nav.Step(active,{},false,0,0,false);
+        Check(!menus::Busy(report),"A release reaches native UI while simulator retains focus");
+        Check(menus::Allowed(uint32_t(menus::Mode::Native),7,7,true,false),"front-end mirror accepts Native tag");
+        Check(!menus::Allowed(uint32_t(menus::Mode::Native),7,8,true,false),"stale character panel epoch is rejected");
+        panels::MouseGate mouse;
+        Check(mouse.Step(placed&&focused,true,true,false).press[0]==(placed&&focused),
+              "front-end exemption never injects a background mouse click");
+    }
+
     for(int preset=0;preset<3;++preset)for(bool main:{false,true}) {
         const float distance=panels::MenuDistance(preset,main);
         Check(std::fabs(distance-(main?.70f:.55f)-.30f*preset)<.00001f,"distance presets add 30 cm without changing canvas scale");
diff --git a/steamvr/pad_mirror_policy.h b/steamvr/pad_mirror_policy.h
new file mode 100644
index 0000000..7e57d71
--- /dev/null
+++ b/steamvr/pad_mirror_policy.h
@@ -0,0 +1,18 @@
+#pragma once
+#include "../external/bodywalk/pad_mirror_shared.h"
+#include "menu_controls.h"
+
+namespace framevr::menus {
+// Internal XR publication can pause during loading. Keep that virtual device
+// connected, but release every control. External writers still time out.
+inline bool CopyMirror(const BWPadMirror& source,bool fresh,uint32_t owner,BWPadMirror& out) {
+    if(source.version!=BW_PAD_MIRROR_VERSION)return false;
+    if(!fresh&&(source.writer_pid!=owner||!Tagged(source.reserved[0])))return false;
+    out=source;
+    if(!fresh) {
+        out.buttons=0;out.left_trigger=out.right_trigger=0;
+        out.thumb_lx=out.thumb_ly=out.thumb_rx=out.thumb_ry=0;
+    }
+    return true;
+}
+}
diff --git a/steamvr/panel_atlas.h b/steamvr/panel_atlas.h
index 2ac7138..6141f4a 100644
--- a/steamvr/panel_atlas.h
+++ b/steamvr/panel_atlas.h
@@ -1,5 +1,6 @@
 #pragma once
 #include "arcane_decay.h"
+#include "frontend_controls.h"
 #include "blood_screen.h"
 #include "bow_laser.h"
 #include "glyph_trail.h"
@@ -58,7 +59,8 @@ constexpr Region Strain{Blood.x+Blood.w+Gap,Blood.y,strain::Size,strain::Size};
 constexpr Region Notice{Strain.x+Strain.w+Gap,Blood.y,notice::Width,notice::Height};
 constexpr Region BowLaser{Notice.x+Notice.w+Gap,Blood.y,bowlaser::AtlasWidth,bowlaser::AtlasHeight};
 constexpr Region ArcaneDecay{Strain.x,Strain.y+Strain.h+Gap,arcane::Size,arcane::Size};
-constexpr int SharedWidth=2048,SharedHeight=Blood.y+Blood.h;
+constexpr Region Frontend{0,Blood.y+Blood.h+Gap,frontend::Width,frontend::Height};
+constexpr int SharedWidth=2048,SharedHeight=Frontend.y+Frontend.h;
 
 constexpr bool Inside(Region r,int width,int height){return r.x>=0&&r.y>=0&&r.w>0&&r.h>0&&r.x+r.w<=width&&r.y+r.h<=height;}
 // Apart by at least Gap texels on one axis.
diff --git a/steamvr/panel_atlas_test.cpp b/steamvr/panel_atlas_test.cpp
index 93594b2..ff7feaf 100644
--- a/steamvr/panel_atlas_test.cpp
+++ b/steamvr/panel_atlas_test.cpp
@@ -10,7 +10,7 @@ int main() {
         Respec(0),Respec(1),Respec(2),Respec(3),Respec(4),Respec(5),Respec(6),Respec(7)};
     constexpr int Statics=int(sizeof statics/sizeof statics[0]);
     static_assert(Statics==6+RespecPictures,"every static picture checked");
-    const Region shared[]={Settings,Blood,Strain,Notice,BowLaser,ArcaneDecay,Glyph};
+    const Region shared[]={Settings,Blood,Strain,Notice,BowLaser,ArcaneDecay,Glyph,Frontend};
     constexpr int Shared=int(sizeof shared/sizeof shared[0]);
     for(const auto& r:statics)assert(Inside(r,StaticWidth,StaticHeight));
     for(const auto& r:shared)assert(Inside(r,SharedWidth,SharedHeight));
diff --git a/steamvr/transport.cpp b/steamvr/transport.cpp
index 7710bd9..27f1dca 100644
--- a/steamvr/transport.cpp
+++ b/steamvr/transport.cpp
@@ -48,6 +48,7 @@
 #include "interaction_ui.h"
 #include "sewer_prompt_art.h"
 #include "notice_card_art.h"
+#include "frontend_controls_art.h"
 #include "arcane_decay.h"
 #include "glyph_cast.h"
 #include "glyph_trail.h"
@@ -120,7 +121,7 @@
 
 namespace gamestate {uint32_t WeaponType();uint32_t HandsKey();uint32_t WeaponSet();uint32_t WeaponClass();uint32_t TwoHanded();uint64_t LocalPlayer();uint32_t MenuEpoch();}
 namespace gamecmd {void RequestPotion(int slot);void CancelPotion();}
-namespace gamestate {void MenuMap(bool wanted);uint32_t QuestNotices();bool NoticePanelOpen();bool NoticeText(int kind,char* out,uint32_t size);}
+namespace gamestate {void MenuMap(bool wanted);uint32_t QuestNotices();bool NoticePanelOpen();bool TitleScreenOpen();int FrontendScreen();void FrontendPad();bool NoticeText(int kind,char* out,uint32_t size);}
 namespace gamestate {bool LeftShield();bool RightThrowingPotion();uint32_t RightThrowingPotionCode();framevr::dualwield::Equipment MeleeEquipment();}
 namespace combat {float GameVolume();}
 namespace projectiles {int ObservedGait(uint64_t& at,bool* tired);void StickFullRun(bool on);}
@@ -146,6 +147,7 @@ XR_FUNCTIONS(DECLARE)
 PFN_xrGetInstanceProcAddr getProc=nullptr;
 HMODULE loader=nullptr;
 bool wineOpenXR=false;
+bool oxrsysRuntime=false;
 // Frame generation (frame_generation.h): the settings now, packed as
 // mode*100+preset*10+scale (-1 before the INI is read), how this instance
 // started with OFXR Bridge and the layer's control API while it is loaded.
@@ -265,6 +267,11 @@ bool glyphDrawClear=false;   // a game skill was put on the draw button: draw_sl
 // Quest / level-up notices: a card standing in the room for a few seconds
 // instead of the native panel at the eyes (notice_card.h). Each card is
 // painted once, in the background, when it comes up.
+frontend::Controls frontendControls;
+LatestWorker<frontend::Controls,std::vector<uint8_t>> frontendPainter(frontend::Paint);
+uint64_t frontendPaintRequest=0;
+int frontendPaintKey=-1;
+bool frontendAtlasPending=false,frontendImageReady=false;
 struct NoticeJob {char text[256]{};};
 LatestWorker<NoticeJob,std::vector<uint8_t>> noticePainter([](const NoticeJob& job) {
     std::vector<uint8_t> pixels;notice::Paint(job.text,pixels);return pixels;
@@ -835,6 +842,7 @@ elements::Scene elementalScene;
 panels::MouseGate panelMouse;
 menus::ReleaseGate menuControls;
 menus::Navigation menuNavigation;
+menus::TitleAccept titleAccept;
 menus::Pad nativeMenuPad;
 menus::LaserClick laserClick;
 panels::ScrollGate panelScroll;
@@ -1084,7 +1092,7 @@ void ClearInput() {
     wristHeading.Reset();compassFrame=false;mapZoom.Reset();wristMapLooked=false;
     panelinput::WorldInput(false);
     gamestate::MenuMap(false);
-    menuControls.Suspend();menuNavigation.Reset();nativeMenuPad={};laserClick={};panelinput::UseController();
+    menuControls.Suspend();menuNavigation.Reset();titleAccept={};nativeMenuPad={};laserClick={};panelinput::UseController();
     statsPress.Reset();statsShown=statsLit=false;menuDrop.Reset();
     handControls.Suspend();
     bodyCalibration.Suspend();
@@ -1347,6 +1355,7 @@ bool LoadFunctions() {
     XrInstanceProperties props{XR_TYPE_INSTANCE_PROPERTIES};pGetInstanceProperties(instance,&props);
     char b[192];std::snprintf(b,sizeof b,"Frame OpenXR: runtime %s",props.runtimeName);Say(b);
     runtimeVdxr.store(std::strstr(props.runtimeName,"VirtualDesktop")!=nullptr);
+    oxrsysRuntime=std::strstr(props.runtimeName,"OXRSys")!=nullptr;
     XrSystemGetInfo si{XR_TYPE_SYSTEM_GET_INFO};si.formFactor=XR_FORM_FACTOR_HEAD_MOUNTED_DISPLAY;
     if(!Check(pGetSystem(instance,&si,&system),"get headset system"))return false;
     XrSystemProperties limits{XR_TYPE_SYSTEM_PROPERTIES};
@@ -1617,6 +1626,7 @@ std::vector<uint8_t> PaintPointer() {
         const float radius=std::hypot((x-31.5f)/30.f,(y-63.5f)/30.f);
         p[3]=y<32?200:uint8_t(std::clamp((1-radius)*10,0.f,1.f)*255);
     }
+    pixels[(32*64)*4]=pixels[(32*64)*4+1]=pixels[(32*64)*4+2]=0; // transparent black backdrop texel
     return pixels;
 }
 // Static text atlas: painted once, never repainted in the frame loop; empty if
@@ -1731,6 +1741,7 @@ bool SetupStatic(DXGI_FORMAT eyeFormat) {
     if(!bloodPainter.Start())Say("Frame blood visor: background painter unavailable; blood stays hidden");
     if(!arcanePainter.Start())Say("Frame arcane decay: background painter unavailable; arcane warning stays hidden");
     if(!glyphPainter.Start())Say("Frame glyph: background painter unavailable; glyph trails stay hidden");
+    if(!frontendPainter.Start())Say("Frame front-end: keyboard painter unavailable");
     if(!noticePainter.Start())Say("Frame notices: background painter unavailable; quest and level-up cards stay hidden");
     if(!strainPainter.Start())Say("Frame guard strain: background painter unavailable; the light stays hidden");
     if(!settingsPainter.Start())Say("Frame VR settings: background painter unavailable; VR Settings and calibration cannot be shown");
@@ -1958,11 +1969,14 @@ void MenuPointer(const menus::Pad& controls) {
     if(settingsModel.open||bodyCalibration.Active()||calibrationRelease.blocked){panelinput::ItemHover(false);menuDrop.Reset();respecShown=false;respecButton.Hide();return;}
     const bool spatialReady=spatialMode&&SurfacePlaced()&&uiCrop[2]>0;
     const bool uiActive=(panelMode&&menuPlaced)||spatialReady;
+    const bool frontend = panelMode && !(inWorld && inWorld());
+    if(frontend&&uiActive)gamestate::FrontendPad();
     const auto surfacePose=spatialMode?UiSurfacePose():menuPose;
     const auto surface=spatialMode?UiSurfaceSize():panels::Fit(width,height,panelWidth);
     const bool pressed=controls.rt>140;
     bool focused=gameWindow&&GetForegroundWindow()==gameWindow;
-    if(uiActive&&menus::Busy(controls)&&!focused)focused=FocusGameForUi();
+    // Front-end pad reports do not need OS focus; leave simulator key releases with it.
+    if(uiActive&&!frontend&&menus::Busy(controls)&&!focused)focused=FocusGameForUi();
     XrSpaceLocation aim{XR_TYPE_SPACE_LOCATION};
     const auto flags=XR_SPACE_LOCATION_POSITION_VALID_BIT|XR_SPACE_LOCATION_ORIENTATION_VALID_BIT|
         XR_SPACE_LOCATION_POSITION_TRACKED_BIT|XR_SPACE_LOCATION_ORIENTATION_TRACKED_BIT;
@@ -2047,10 +2061,41 @@ void MenuPointer(const menus::Pad& controls) {
     menus::Pad navigation=controls;
     if(leatherMode&&leatherShown.load())navigation.lx=navigation.ly=navigation.rx=navigation.ry=0;
     if(onButton||statsPress.Held()||respecPress.Held()||dropOwns)navigation.rt=0;   // a button's or the drop's trigger is never the game's RT
-    nativeMenuPad=menuNavigation.Step(uiActive&&focused,navigation,pointerHit&&!onButton,hit.u,hit.v,mouseDown||rightMouseDown);
+    nativeMenuPad=menuNavigation.Step(menus::NavigationActive(uiActive,focused,frontend),navigation,pointerHit&&!onButton,hit.u,hit.v,mouseDown||rightMouseDown);
+    if(titleAccept.Step(oxrsysRuntime&&frontend&&uiActive,gamestate::TitleScreenOpen(),nativeMenuPad)) {
+        if(gameWindow) {
+            PostMessageW(gameWindow,WM_KEYDOWN,VK_RETURN,0x001c0001);
+            PostMessageW(gameWindow,WM_KEYUP,VK_RETURN,0xc01c0001);
+            Say("Frame panels: title accept posted to game window; desktop focus unchanged");
+        }
+    }
+    const int frontendScreen=frontend&&uiActive?gamestate::FrontendScreen():0;
+    if(frontendScreen!=frontendControls.screen){char line[100];std::snprintf(line,sizeof line,"Frame front-end: screen %d (list=1 classes=2 name=3)",frontendScreen);Say(line);}
+    const auto entry=frontendControls.Step(frontendScreen,nativeMenuPad,GetTickCount64());
+    nativeMenuPad=entry.pad;
+    if(gameWindow&&entry.back) {
+        PostMessageW(gameWindow,WM_KEYDOWN,VK_ESCAPE,0x00010001);
+        PostMessageW(gameWindow,WM_KEYUP,VK_ESCAPE,0xc0010001);
+        Say("Frame front-end: B opened native exit confirmation; desktop focus unchanged");
+    }
+    if(gameWindow&&(entry.text||entry.erase)) {
+        PostMessageW(gameWindow,frontend::NameKeyMessage,entry.erase?8:entry.text,0);
+        Say(entry.erase?"Frame name keyboard: erase sent":"Frame name keyboard: character sent");
+    }
+    if(frontendControls.Visible()) {
+        const int key=frontendScreen*100+frontendControls.selected+(frontendControls.upper?1000:0);
+        if(key!=frontendPaintKey) {
+            frontendPaintRequest=frontendPainter.Submit(frontendControls);frontendPaintKey=key;
+        }
+        std::vector<uint8_t> painted;
+        if(frontendPaintRequest&&!frontendAtlasPending&&atlasUploads.size()<3&&frontendPainter.Take(frontendPaintRequest,painted)) {
+            if(!painted.empty())UploadShared(panelatlas::Frontend,painted,&frontendAtlasPending);
+            frontendPaintRequest=0;
+        }
+    } else {frontendPaintKey=-1;frontendImageReady=false;}
     if(statsPress.Held())nativeMenuPad.buttons|=menus::Back;   // View: Advanced Stats (Start closes the menu)
     if(menuDrop.Down())nativeMenuPad.buttons|=menus::X;   // X: the controller menu's Drop for the item on the cursor
-    if(wasNative!=menuNavigation.Native()&&uiActive&&focused)
+    if(wasNative!=menuNavigation.Native()&&menus::NavigationActive(uiActive,focused,frontend))
         Say(menuNavigation.Native()?"Frame panels: native controller navigation":"Frame panels: laser navigation");
     const bool laser=!menuNavigation.Native();
     if(!laser){panelinput::UseController();pointerVisible=pointerHit=false;}
@@ -3218,7 +3263,7 @@ void Input() {
     }
     settingsOwned=settingsOwned||settingsModel.open;
     bool focused=gameWindow&&GetForegroundWindow()==gameWindow;
-    if(!settingsOwned&&(menuPressed||inventoryPressed)&&!focused)focused=FocusGameForUi();
+    if(!settingsOwned&&!(panelMode&&!(inWorld&&inWorld()))&&(menuPressed||inventoryPressed)&&!focused)focused=FocusGameForUi();
     if(heldKeyScan&&(!focused||GetTickCount64()>=keyReleaseAt))ReleaseUiKey();
     if(!settingsOwned&&!nativeUi&&focused&&menuPressed)PulseUiKey(VK_ESCAPE);
     if(!settingsOwned&&(!nativeUi||gripMenuPressed)&&inventoryPressed&&inWorld&&inWorld()) {
@@ -5864,11 +5909,11 @@ void EndPair() {
     // The shared panels' pictures uploaded this frame, all in one copy (panelatlas).
     if(sharedDirty) {
         const bool flushed=FlushShared();
-        for(auto* p:{&settingsAtlasPending,&bloodAtlasPending,&strainAtlasPending,&bowLaserAtlasPending,&noticeAtlasPending,&arcaneAtlasPending,&glyphAtlasPending})if(*p) {
+        for(auto* p:{&settingsAtlasPending,&bloodAtlasPending,&strainAtlasPending,&bowLaserAtlasPending,&noticeAtlasPending,&arcaneAtlasPending,&glyphAtlasPending,&frontendAtlasPending})if(*p) {
             *p=false;
             if(p==&settingsAtlasPending)settingsImageReady=flushed;else if(p==&bloodAtlasPending)bloodImageReady=flushed;
             else if(p==&strainAtlasPending)strainImageReady=flushed;else if(p==&bowLaserAtlasPending)bowLaserImageReady=flushed;
-            else if(p==&arcaneAtlasPending)arcaneImageReady=flushed;else if(p==&glyphAtlasPending)glyphImageReady=flushed;else noticeImageReady=flushed;
+            else if(p==&arcaneAtlasPending)arcaneImageReady=flushed;else if(p==&glyphAtlasPending)glyphImageReady=flushed;else if(p==&frontendAtlasPending)frontendImageReady=flushed;else noticeImageReady=flushed;
         }
     }
     // The native menus closed short of swapchains: their surface goes back for the map.
@@ -5889,9 +5934,18 @@ void EndPair() {
     // [interactions] leather_world=0: the leather against the same black (a test fallback).
     const bool blackMenu=((opaqueMenuMode&&workspacePlaced)||(leatherMode&&!leatherShown.load()&&leatherHolder.Placed()))&&
         uiEye.copied&&uiCrop[2]>0&&!settingsModel.open&&!bodyCalibration.Active();
+    XrCompositionLayerProjection backdrop{XR_TYPE_COMPOSITION_LAYER_PROJECTION};
+    XrCompositionLayerProjectionView backdropEyes[2]{};
+    const bool menuBackdrop=oxrsysRuntime&&pointerChain&&render&&valid&&
+        (blackMenu||(layer&&layer->type==XR_TYPE_COMPOSITION_LAYER_QUAD));
+    if(menuBackdrop) {
+        composition::BlackBackdrop(backdrop,backdropEyes,views.data(),space,pointerChain,{panelatlas::Pointer.x,panelatlas::Pointer.y+32});
+        layers[count++]=reinterpret_cast<const XrCompositionLayerBaseHeader*>(&backdrop);
+        static bool told=false;if(!told){told=true;Say("Frame OpenXR: black projection backdrop for OXRSys quad menus");}
+    }
     if(layer&&!blackMenu)layers[count++]=layer;
     const uint32_t capacity=std::min(uint32_t(layers.size()),layerLimit);
-    const bool padQuads=composition::NeedsQuadPadding(wineOpenXR,layer,pointerChain);
+    const bool padQuads=composition::NeedsQuadPadding(wineOpenXR,count?layers[0]:nullptr,pointerChain);
     const uint32_t contentLimit=padQuads&&capacity>1?capacity-1:capacity;
     XrCompositionLayerQuad palette{XR_TYPE_COMPOSITION_LAYER_QUAD},bottle{XR_TYPE_COMPOSITION_LAYER_QUAD},chosen{XR_TYPE_COMPOSITION_LAYER_QUAD};
     std::array<XrCompositionLayerQuad,2> arrow{{{XR_TYPE_COMPOSITION_LAYER_QUAD},{XR_TYPE_COMPOSITION_LAYER_QUAD}}};
@@ -6031,6 +6085,13 @@ void EndPair() {
     // dialogue surfaces; opaque menus, the leather and VR Settings hold it back.
     // The mod's own message also shows over the flat menu panel and the
     // leather (VR Settings opened from the title screen could not draw).
+    XrCompositionLayerQuad frontendQuad{XR_TYPE_COMPOSITION_LAYER_QUAD};
+    if(frontendControls.Visible()&&frontendImageReady&&sharedChain&&layer&&panelMode&&!settingsModel.open&&!bodyCalibration.Active()) {
+        auto pose=menuPose;
+        const auto p=V(pose.position)+math::Rotate(Q(pose.orientation),{0,-.48f,.08f});
+        pose.position={p.x,p.y,p.z};
+        motionQuad(frontendQuad,pose,1.12f,1.12f*frontend::Height/frontend::Width,Rect(panelatlas::Frontend),sharedChain);
+    }
     XrCompositionLayerQuad noticeQuad{XR_TYPE_COMPOSITION_LAYER_QUAD};
     const bool noticeMessage=noticeCard.kind==notice::Message;
     if(noticeImageReady&&sharedChain&&noticeCard.kind>=0&&noticePaintedSequence==noticeCard.sequence&&
@@ -6797,7 +6858,7 @@ void Shutdown(bool preserveResolution) {
     if(!preserveResolution)hud::NativeSession(false);
     if(!preserveResolution)resolution::Restore();
     windowFocus.Cancel();
-    EndPair();ClearInput();interactionPainter.Stop();bloodPainter.Stop();arcanePainter.Stop();glyphPainter.Stop();strainPainter.Stop();noticePainter.Stop();settingsPainter.Stop();turnCompiler.Stop();interaction::icons::Shutdown();
+    EndPair();ClearInput();interactionPainter.Stop();bloodPainter.Stop();arcanePainter.Stop();glyphPainter.Stop();strainPainter.Stop();noticePainter.Stop();frontendPainter.Stop();settingsPainter.Stop();turnCompiler.Stop();interaction::icons::Shutdown();
     // Completion is mandatory before destroying our commands/resources, even
     // when ordinary frame submission uses queue ordering without a CPU wait.
     if(fence&&!WaitGpu())failed=true;
@@ -6820,6 +6881,7 @@ void Shutdown(bool preserveResolution) {
     arcaneController.Reset();arcaneOutput={};arcanePaintKey=~0ull;arcanePaintSession=0;arcanePaintAt=0;arcaneAtlasPending=arcaneImageReady=false;
     glyphStroke={};glyphCast={};glyphPaintKey=glyphShownStroke=0;glyphBeganAt=0;glyphEndedAt=-1;glyphPaintAt=0;glyphLook=glyphtrail::Look::Drawing;glyphPressRt=glyphTrailShown=false;glyphAtlasPending=glyphImageReady=false;
     bowLaserHue=-1;bowLaserAtlasPending=bowLaserImageReady=false;
+    frontendControls={};frontendPaintKey=-1;frontendPaintRequest=0;frontendAtlasPending=frontendImageReady=false;
     noticeWatch={};noticeCards.Clear();noticeCard={};noticePaintRequest=noticeRequestedSequence=noticePaintedSequence=0;noticeAtlasPending=noticeImageReady=false;
     heartStream.Stop();heartPlaying=false;heartLevel.Reset();heartAt=0;heartHush.Reset();heartHealth=-1;
     guardStrain.Reset();strainOutput={};strainPaintKey=~0ull;strainPaintSession=0;strainPaintAt=0;strainAtlasPending=strainImageReady=strainSlotReported=false;
diff --git a/vr/gamestate.cpp b/vr/gamestate.cpp
index 1251de1..8fd4589 100644
--- a/vr/gamestate.cpp
+++ b/vr/gamestate.cpp
@@ -337,6 +337,9 @@ std::atomic<bool> g_respecButton{false};  // its Character page alone: Reset Ski
 std::atomic<uint32_t> g_panelChanges{0};   // every panel opened or closed (leather::Back)
 std::atomic<bool> g_npcChoices{false};
 std::atomic<uint32_t> g_questNotices{0};   // quest updates while the notification panel is hidden
+std::atomic<bool> g_titlePanel{false};
+std::atomic<int> g_frontend{0}; // 1 list, 2 classes, 3 name
+std::atomic<uint64_t> g_frontendPadAt{0};
 std::atomic<bool> g_noticePanel{false};     // the native NotificationPanel is open (hidden or not)
 std::mutex noticeMutex;
 char noticeTexts[framevr::notice::Kinds][256]{};
@@ -698,6 +701,9 @@ void __cdecl ReadItems(const PluginContext* ctx, void* token) noexcept {
 #ifdef D2RVR_NATIVE_OPENXR
     respec::Poll();   // Reset Skills & Stats: the minted token's native use (respec.cpp)
     panelinput::MaintainWorldController(havePlayer,g_menu.load()!=0);
+    const auto frontendAt=g_frontendPadAt.load();
+    if(!havePlayer&&g_frontend.load()>0&&g_frontend.load()<3&&frontendAt&&GetTickCount64()-frontendAt<400)
+        panelinput::ControllerReady();
     MaintainToolbar(ctx);
     ReadNoticeTexts();
     const auto now=GetTickCount64(),mapAt=g_menuMapAt.load();
@@ -890,7 +896,17 @@ SharedEvents::UiMessageAction __cdecl OnUiMessage(const PluginContext* ctx, cons
         snprintf(b, sizeof b, "gamestate: ui message '%s' '%s' text '%.80s'", target, command, text);
         Log(b);
     }
+    if(!strcmp(target,"CharacterCreate")) {
+        if(!strcmp(command,"Select"))g_frontend=3;
+        else if(!strcmp(command,"Unselect"))g_frontend=2;
+    }
     if (strcmp(target, "PanelManager") == 0) {
+        const bool opening=!strcmp(command,"OpenPanel")||!strcmp(command,"OpenExclusivePanel");
+        if(opening&&!strcmp(text,"MainMenuPanel"))g_frontend=1;
+        else if(opening&&!strcmp(text,"CharacterCreatePanel"))g_frontend=2;
+        else if(opening&&!strcmp(text,"TitleScreenPanel"))g_frontend=0;
+        else if((!strcmp(command,"UnloadPanel")||!strcmp(command,"ClosePanel"))&&
+                ((!strcmp(text,"MainMenuPanel")&&g_frontend==1)||(!strcmp(text,"CharacterCreatePanel")&&g_frontend>=2)))g_frontend=0;
         const bool before = g_menu.load() != 0;
         if (!strcmp(command, "OpenPanel") || !strcmp(command, "OpenExclusivePanel")) { if (*text) g_panels.insert(text); }
         else if (!strcmp(command, "ClosePanel") || !strcmp(command, "UnloadPanel")) g_panels.erase(text);
@@ -899,6 +915,7 @@ SharedEvents::UiMessageAction __cdecl OnUiMessage(const PluginContext* ctx, cons
             !strcmp(command, "UnloadPanel") || !strcmp(command, "UnloadAll") || !strcmp(command, "CloseAll")) g_panelChanges.fetch_add(1);
         g_autoMap.store(g_panels.count("AutoMap") ? 1 : 0);
         framevr::fullmap::g_panel.store(g_panels.count("AutoMap") != 0);
+        g_titlePanel.store(g_panels.count("TitleScreenPanel") != 0);
         g_noticePanel.store(g_panels.count("NotificationPanel") != 0);
         g_upperBandMenu.store(std::any_of(g_panels.begin(),g_panels.end(),
             [](const auto& name){return framevr::panels::UpperBand(name);}));
@@ -1122,6 +1139,9 @@ int ObjectLight(uint32_t txt, uint32_t mode, float rgb[3]) {
 }
 
 uint32_t QuestNotices(){return g_questNotices.load();}
+int FrontendScreen(){return g_menu.load()?0:g_frontend.load();}
+void FrontendPad(){g_frontendPadAt=GetTickCount64();}
+bool TitleScreenOpen(){return g_titlePanel.load();}
 bool NoticePanelOpen(){return g_noticePanel.load();}
 bool NoticeText(int kind,char* out,uint32_t size) {
     if(kind<0||kind>=framevr::notice::Kinds||!out||!size)return false;
diff --git a/vr/vrcam.cpp b/vr/vrcam.cpp
index 6dcd253..3becc42 100644
--- a/vr/vrcam.cpp
+++ b/vr/vrcam.cpp
@@ -21,6 +21,8 @@
 #ifndef NOMINMAX
 #define NOMINMAX
 #endif
+#include "../steamvr/frontend_controls.h"
+namespace gamestate {int FrontendScreen();}
 #include <windows.h>
 #include "pcvr_identity.h"
 #include "pcvr_mod_layout.h"
@@ -114,6 +116,7 @@ namespace gamestate {bool RunOnUi(D2RL::Threads::Callback callback);}
 #include "light_bounds.h"
 #include "game_device_only.h"
 #include "menu_controls.h"
+#include "pad_mirror_policy.h"
 #include "xinput_rumble.h"
 #include "native_panels.h"
 #include "spell_aim.h"
@@ -4451,9 +4454,18 @@ bool PadMirrorRead(BWPadMirror* out) {
     static std::atomic<ULONGLONG> movedAt{0};
     const BWPadMirror m = *p;
     if (m.counter != seen.load()) { seen.store(m.counter); movedAt.store(GetTickCount64()); }
-    if (m.version != BW_PAD_MIRROR_VERSION || GetTickCount64() - movedAt.load() > 1000) return false;
-    *out = m;
-    return true;
+    const bool fresh=GetTickCount64()-movedAt.load()<=1000;
+#ifdef D2RVR_NATIVE_OPENXR
+    const bool available=framevr::menus::CopyMirror(m,fresh,GetCurrentProcessId(),*out);
+    if(available&&!fresh) {
+        static std::atomic<bool> told{false};
+        if(!told.exchange(true))Log("Frame input: XR publication paused; virtual pad connected with neutral controls");
+    }
+    return available;
+#else
+    if(m.version!=BW_PAD_MIRROR_VERSION||!fresh)return false;
+    *out=m;return true;
+#endif
 }
 
 bool PadFromBodyWalk(XINPUT_STATE* s, BWPadMirror* report=nullptr) {
@@ -5962,6 +5974,30 @@ void HookCursor() {
 // and panels on them) - but not while the chat line is open: then they are
 // letters, and every other key goes to the game anyway.
 LRESULT CALLBACK GameWndProc(HWND h, UINT msg, WPARAM w, LPARAM l) {
+#ifdef D2RVR_NATIVE_OPENXR
+    // Use the native key-down/TranslateMessage path for text entry. Scope the
+    // virtual keyboard's modifiers to this UI thread and this one native call.
+    // No desktop focus or system-wide key state is changed.
+    if(msg==framevr::frontend::NameKeyMessage) {
+        if(g_set.platform.load()!=1||g_inWorld.load()||gamestate::FrontendScreen()!=3)return 0;
+        const SHORT mapping=w==8?VK_BACK:VkKeyScanW(wchar_t(w));
+        if(mapping==-1)return 0;
+        BYTE saved[256]{};if(!GetKeyboardState(saved))return 0;
+        BYTE keys[256];std::memcpy(keys,saved,sizeof keys);
+        for(int key:{VK_SHIFT,VK_LSHIFT,VK_RSHIFT,VK_CONTROL,VK_LCONTROL,VK_RCONTROL,VK_MENU,VK_LMENU,VK_RMENU,VK_CAPITAL})keys[key]=0;
+        if(mapping&0x100)keys[VK_SHIFT]=keys[VK_LSHIFT]=0x80;
+        const auto key=BYTE(mapping);keys[key]=0x80;SetKeyboardState(keys);
+        const LPARAM scan=LPARAM(MapVirtualKeyW(key,MAPVK_VK_TO_VSC))<<16;
+        MSG keyMessage{};keyMessage.hwnd=h;keyMessage.message=WM_KEYDOWN;keyMessage.wParam=key;keyMessage.lParam=scan|1;
+        TranslateMessage(&keyMessage);
+        panelinput::Typed(0);
+        Log("Frame name keyboard: native key translated on window thread");
+        CallWindowProcW(g_gameWndProc,h,WM_KEYDOWN,key,scan|1);
+        keys[key]=0;SetKeyboardState(keys);
+        CallWindowProcW(g_gameWndProc,h,WM_KEYUP,key,scan|0xc0000001);
+        SetKeyboardState(saved);return 0;
+    }
+#endif
 #ifdef D2RVR_NATIVE_OPENXR
     LRESULT resolutionResult=0;
     if(framevr::resolution::Handle(h,msg,w,l,g_gameWndProc,resolutionResult))return resolutionResult;
@@ -9691,6 +9727,16 @@ void OnBind(command_list* cl, uint32_t count, const resource_view* rtvs, resourc
     }
     Note();
 }
+// The game can bind its targets with D3D12 render passes instead (it does under
+// D3DMetal on macOS): the same depth buffer, so the same bookkeeping (2026-11-25).
+bool OnBeginPass(command_list* cl, uint32_t count, const render_pass_render_target_desc* rts,
+                 const render_pass_depth_stencil_desc* ds, render_pass_flags) {
+    resource_view rtvs[8] = {};
+    const uint32_t n = rts ? std::min<uint32_t>(count, 8) : 0;
+    for (uint32_t i = 0; i < n; ++i) rtvs[i] = rts[i].view;
+    OnBind(cl, n, rtvs, ds ? ds->view : resource_view{0});
+    return false;
+}
 void OnViewports(command_list* cl, uint32_t first, uint32_t count, const viewport* vps) {
     if (first != 0 || count == 0) return;
     if (cl != t_cl) { t_cl = cl; t_dsW = t_dsH = 0; }
@@ -10489,6 +10535,7 @@ void TryRegister() {
 #endif
 #ifdef D2RVR_NATIVE_OPENXR
     reshade::register_event<reshade::addon_event::bind_render_targets_and_depth_stencil>(&d2rvr::D3D12Only<&renderscale::OnBind>::Call);
+    reshade::register_event<reshade::addon_event::begin_render_pass>(&d2rvr::D3D12Only<&renderscale::OnBeginPass>::Call);
 #else
     reshade::register_event<reshade::addon_event::bind_render_targets_and_depth_stencil>(&renderscale::OnBind);
 #endif