Skip to content

Fix font scaling slider not working on touchscreens#4682

Open
Dhananjay-JSR wants to merge 1 commit into
ChrisTitusTech:mainfrom
Dhananjay-JSR:claude/slider-touch-screen-uiy80u
Open

Fix font scaling slider not working on touchscreens#4682
Dhananjay-JSR wants to merge 1 commit into
ChrisTitusTech:mainfrom
Dhananjay-JSR:claude/slider-touch-screen-uiy80u

Conversation

@Dhananjay-JSR

@Dhananjay-JSR Dhananjay-JSR commented Jun 9, 2026

Copy link
Copy Markdown

What

Makes the Font Scaling slider usable on touchscreen devices.

Why

WPF Slider thumbs only respond to mouse drag. On touch-only devices (handhelds, tablets, 2-in-1s) on my Asus Rog ally x it doesn't work , touch isn't promoted to the mouse input the thumb relies on, so the slider can't be moved by finger at all.

How

  • Added Set-WinUtilSliderFromTouch, which maps a horizontal touch position onto the slider's range and snaps to the nearest tick.
  • Wired the slider's PreviewTouchDown/Move/Up events to capture the touch and drive the value as the finger moves.
  • Set IsMoveToPointEnabled and disabled the press-and-hold stylus gesture so tapping the track jumps to that point without a long-press delay.

Testing

Compiled with .\Compile.ps1 -Run and confirmed on a touchscreen handheld: the slider now drags and snaps by touch. Mouse and keyboard behavior is unchanged.

Drive the slider value from touch events so the thumb follows the finger;
WPF sliders only respond to mouse drag otherwise.
@vyas-devgna

Copy link
Copy Markdown
Contributor

which device do you have is it a convertible or a tablet

@vyas-devgna

Copy link
Copy Markdown
Contributor

Could you test a simpler XAML-only approach? WPF sliders usually ignore touch because the parent ScrollViewer intercepts them for panning. Instead of manually capturing touch events and calculating the slider value in PowerShell, you can drop the PowerShell code entirely and just add ScrollViewer.PanningMode="VerticalOnly" to the element in inputXML.xaml (alongside your other additions). This stops the ScrollViewer from stealing touch events, allowing the slider's native touch behavior to work automatically

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.

2 participants