-
Posts
-
By Jdoe25 · Posted
M$ can bring whatever the hell it wants, and then guess what's not installed in my Mac. -
By TarasBuria · Posted
Windows 11's big performance boost is finally available for all by Taras Buria Over the last few months, Microsoft has been very busy fixing Windows 11 with features that users have been asking the company for a long time. An upgraded Start menu, the ability to change the taskbar position, new Windows Update features, and plenty more. However, not all changes are visible on the surface. Some exciting upgrades happened under the hood, and one of those upgrades is now available to all Windows 11 users. The so-called "Low Latency Profile" is a special performance mode that aims to make Windows 11 snappier and more responsive. It boosts the processor clock speed to its maximum for a brief moment when rendering user interface elements or launching apps. As such, apps launch faster, and things like the Start menu or quick settings appear on the screen faster, although some are sceptical about it. Microsoft is not sharing many details about the new profile. The official release notes do not even mention it, with Microsoft only saying that the update "accelerates app launch and core shell experiences such as Start menu, Search, and Action Center." Also, you may need to enable it manually, as new features are rolling out gradually. Here is how to do it: Download ViVeTool from GitHub and unpack wherever convenient. Navigate to the folder containing the ViveTool files with the CD command. For example, if you have placed ViveTool in C:\Vive, type CD C:\Vive. Type vivetool /enable /id:58989092 and press Enter. Restart your computer. After restarting your computer, launch Task Manager or any other hardware-monitoring software and check the processor clocks when opening the Start menu, Action Center, and more. Your processor should spike to its highest possible speed and then return to lower clocks. In addition to Low Latency Mode, the June 2026 Patch Tuesday update delivers additional features, such as multi-camera mode for apps (several apps can use a single camera stream), shared Bluetooth audio, improved Task Manager, and more. -
By sphbecker · Posted
I agree, especially with newer versions of MS Office supporting ODF documents, there isn't even a compatibility argument to be made. It should default to ODF on a clean install, with admin configurable options to make MS Office the default if that is desired. -
By Jdoe25 · Posted
Are they on crack at M$? Surely living on an alternative reality? A good dump of mine would run faster down the toilet if I did not flush it. But still looks better than this pile of slop. By the way, did they also comment on what's the next "functionality added"? Maybe you can improve it if you add even more stuff to this vomitware. -
By David Uzondu · Posted
I don't find them "bitchy" or "whiny". I think the term you should use it, uhm, "passionate."
-
-
Recent Achievements
-
FBSPL earned a badge
Week One Done
-
Jim Dugan earned a badge
One Year In
-
Tommi118 earned a badge
One Month Later
-
sjbousquet earned a badge
One Month Later
-
sjbousquet earned a badge
Week One Done
-
-
Popular Contributors
-
Tell a friend
Question
Eric Veteran
Here's a little 5-minute glob of code I hacked together to handle dragging ScrollViewer content around with the mouse (or your finger).
It can also reverse the axes for "natural scrolling." There is also a Tolerance setting that is supposed to prevent it from scrolling if you only drag it a little bit. I did this because my crappy touchscreen driver has a lot of jitter.
I claim no responsibility if it explodes or otherwise has undesired effects. :)
using System; using System.Windows; using System.Windows.Input; using System.Windows.Controls; namespace MouseExtensions { public class MouseDragBehavior { public static readonly DependencyProperty ToleranceProperty = DependencyProperty.RegisterAttached("Tolerance", typeof(double), typeof(MouseDragBehavior), new FrameworkPropertyMetadata((double)10)); public static double GetTolerance(DependencyObject d) { return (double)d.GetValue(ToleranceProperty); } public static void SetTolerance(DependencyObject d, double value) { d.SetValue(ToleranceProperty, value); } public static readonly DependencyProperty ReverseAxisProperty = DependencyProperty.RegisterAttached("ReverseAxis", typeof(bool), typeof(MouseDragBehavior), new FrameworkPropertyMetadata((bool)false)); public static bool GetReverseAxis(DependencyObject d) { return (bool)d.GetValue(ReverseAxisProperty); } public static void SetReverseAxis(DependencyObject d, bool value) { d.SetValue(ReverseAxisProperty, value); } private static readonly DependencyProperty DragStartPointProperty = DependencyProperty.RegisterAttached("DragStartPoint", typeof(Point), typeof(MouseDragBehavior), new FrameworkPropertyMetadata((Point)new Point())); private static Point GetDragStartPoint(DependencyObject d) { return (Point)d.GetValue(DragStartPointProperty); } private static void SetDragStartPoint(DependencyObject d, Point value) { d.SetValue(DragStartPointProperty, value); } private static readonly DependencyProperty DragLastPointProperty = DependencyProperty.RegisterAttached("DragLastPoint", typeof(Point), typeof(MouseDragBehavior), new FrameworkPropertyMetadata((Point)new Point())); private static Point GetDragLastPoint(DependencyObject d) { return (Point)d.GetValue(DragLastPointProperty); } private static void SetDragLastPoint(DependencyObject d, Point value) { d.SetValue(DragLastPointProperty, value); } public static readonly DependencyProperty HandleDragProperty = DependencyProperty.RegisterAttached("HandleDrag", typeof(bool), typeof(MouseDragBehavior), new FrameworkPropertyMetadata((bool)false, new PropertyChangedCallback(OnHandleDragChanged))); public static bool GetHandleDrag(DependencyObject d) { return (bool)d.GetValue(HandleDragProperty); } public static void SetHandleDrag(DependencyObject d, bool value) { d.SetValue(HandleDragProperty, value); } private static void OnHandleDragChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { ScrollViewer scrollViewer = d as ScrollViewer; if ((bool)e.NewValue) { scrollViewer.PreviewMouseDown += new MouseButtonEventHandler(target_PreviewMouseDown); scrollViewer.PreviewMouseMove += new MouseEventHandler(target_PreviewMouseMove); scrollViewer.PreviewMouseUp += new MouseButtonEventHandler(target_PreviewMouseUp); scrollViewer.MouseLeave += new MouseEventHandler(target_MouseLeave); } else { scrollViewer.PreviewMouseDown -= new MouseButtonEventHandler(target_PreviewMouseDown); scrollViewer.PreviewMouseMove -= new MouseEventHandler(target_PreviewMouseMove); scrollViewer.PreviewMouseUp -= new MouseButtonEventHandler(target_PreviewMouseUp); scrollViewer.MouseLeave -= new MouseEventHandler(target_MouseLeave); } } private static bool IsDragging(ScrollViewer scrollViewer) { Point posNow = Mouse.GetPosition(scrollViewer); return ((Math.Abs(GetDragStartPoint(scrollViewer).X - posNow.X) > GetTolerance(scrollViewer)) || (Math.Abs(GetDragStartPoint(scrollViewer).Y - posNow.Y) > GetTolerance(scrollViewer))); } private static void target_PreviewMouseDown(object sender, MouseButtonEventArgs e) { var scrollViewer = (ScrollViewer)sender; var mousePos = e.GetPosition(scrollViewer); scrollViewer.CaptureMouse(); if (GetDragLastPoint(scrollViewer) == new Point()) { SetDragStartPoint(scrollViewer, mousePos); SetDragLastPoint(scrollViewer, mousePos); } if (IsDragging(scrollViewer)) { e.Handled = true; return; } else scrollViewer.ReleaseMouseCapture(); } private static void target_PreviewMouseMove(object sender, MouseEventArgs e) { var scrollViewer = (ScrollViewer)sender; if (GetDragLastPoint(scrollViewer) != new Point()) { Point posNow = e.GetPosition(scrollViewer); double dX = posNow.X - GetDragLastPoint(scrollViewer).X; double dY = posNow.Y - GetDragLastPoint(scrollViewer).Y; SetDragLastPoint(scrollViewer, posNow); if (!IsDragging(scrollViewer)) return; if (GetReverseAxis(scrollViewer)) { scrollViewer.ScrollToHorizontalOffset(scrollViewer.HorizontalOffset + dX); scrollViewer.ScrollToVerticalOffset(scrollViewer.VerticalOffset + dY); } else { scrollViewer.ScrollToHorizontalOffset(scrollViewer.HorizontalOffset - dX); scrollViewer.ScrollToVerticalOffset(scrollViewer.VerticalOffset - dY); } } e.Handled = true; } private static void target_PreviewMouseUp(object sender, MouseButtonEventArgs e) { var scrollViewer = (ScrollViewer)sender; if (GetDragLastPoint(scrollViewer) != new Point() && IsDragging(scrollViewer)) { e.Handled = true; scrollViewer.ReleaseMouseCapture(); } Reset(scrollViewer); } private static void target_MouseLeave(object sender, MouseEventArgs e) { var scrollViewer = (ScrollViewer)sender; Reset(scrollViewer); } private static void Reset(ScrollViewer scrollViewer) { SetDragLastPoint(scrollViewer, new Point()); SetDragStartPoint(scrollViewer, new Point()); } } }To use it simply reference the namespace and set MouseDragBehavior.HandleDrag to true in your
ScrollViewer declaration:
<ScrollViewer xmlns:my="clr-namespace:MouseExtensions" my:MouseDragBehavior.HandleDrag="True" my:MouseDragBehavior.ReverseAxis="True" />Link to comment
https://www.neowin.net/forum/topic/1022710-cwpf-mouse-drag-behavior/Share on other sites
3 answers to this question
Recommended Posts