Is there a method for disabling gestures for Windows8
Asked Answered
P

6

7

We have a need in one of our apps where we need to disable some of the built in gestures for Windows 8 to prevent users from leaving the app. (think kiosk sign in screen). Are there methods for still allowing the user to interact with the app using touch but disabling/intercepting some of the built in gestures (things like docking the app on the left, going to the desktop, etc).

Our backup solution is to disable touch altogether when in certain screens (this is something we can do) but we'd like a better user experience and to just disable the gestures that we absolutely need to (similar to disabling the windows key, ctrl+alt+del instead of the whole keyboard).

Initial searches and investigation haven't turned up what we've been looking for so we're either looking for the wrong thing or in the wrong places.

Pinkie answered 13/9, 2012 at 22:48 Comment(0)
G
5

You can disable gesture in Windows 8 Embedded. Maybe you can try this in Windows 8.

Registry Keys:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ImmersiveShell\EdgeUI]
"DisabledEdges"=dword:0000000f

0x01 : Disables left edge input and app switcher gesture.
0x02 : Disables right edge input and charm bar gesture.
0x04 : Disables top edge input and top application bar gesture.
0x08 : Disables bottom edge input and bottom application bar gesture.

if you want to disables each gesture, just add dword:0000000f (15)

Guthrie answered 5/11, 2012 at 8:44 Comment(1)
Unfortunately did not work using Windows 8.1 with Bing on a Thinkpad 10. would you happen to have any other suggestions?Rakeoff
R
3

To do it programmatically, you can call the function in the link below. It requires the hWnd to the window you would like to target.

http://msdn.microsoft.com/en-us/library/windows/desktop/jj553591%28v=vs.85%29.aspx

The C++ below will search for a window with the window title "helloworld", and disable all of the Windows 8 gestures for it. This does not work for Windows Store apps, and the function has to be called on the window while it is open. If the application is closed and re-opened, the gestures will return. Also, I believe it only works while the application is full-screen.

#include "stdafx.h"
#include <windows.h>
#include <iostream>
#include <propsys.h>
#include <propkey.h>

using namespace std;

HWND windowHandle;

HRESULT SetTouchDisableProperty(HWND hwnd, BOOL fDisableTouch)
{
    IPropertyStore* pPropStore;
    HRESULT hrReturnValue = SHGetPropertyStoreForWindow(hwnd, IID_PPV_ARGS(&pPropStore));
    if (SUCCEEDED(hrReturnValue))
    {
        PROPVARIANT var;
        var.vt = VT_BOOL;
        var.boolVal = fDisableTouch ? VARIANT_TRUE : VARIANT_FALSE;
        hrReturnValue = pPropStore->SetValue(PKEY_EdgeGesture_DisableTouchWhenFullscreen, var);
        pPropStore->Release();
    }
    return hrReturnValue;
}

BOOL CALLBACK MyEnumProc(HWND hWnd, LPARAM lParam)
{
    TCHAR title[500];
    ZeroMemory(title, sizeof(title));    

    GetWindowText(hWnd, title, sizeof(title)/sizeof(title[0]));

    if (!_tcscmp(title, _T("helloworld")))
    {
        SetTouchDisableProperty(hWnd,true);
    }

    return TRUE;
}

int _tmain(int argc, _TCHAR* argv[])
{   
    EnumWindows(MyEnumProc, 0);
    return 0;
}
Revise answered 15/2, 2013 at 2:18 Comment(0)
R
1

Windows charms bar is operated by explorer.exe.

So if your app can run without it then you can hack around it by first disabling the autorestart of explorer.exe via (run as administrator):

reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "AutoRestartShell" /t REG_DWORD /d 0

Then the lines below represent my launch.bat - which works in the end as expected:

;; kill explorer (this disables all windows functionalities
taskkill /f /im explorer.exe

;; start your kiosk app - should block the batch execution (so explorer.exe doesn't get executed at the end)
"\path\to\your\app.exe"

;; relaunch explorer.exe after you close the app to give back the functionality to windows
explorer.exe

I use the approach outlined above to let a keyboardless kiosk app run. Because with a keyboard you can still close the app with alt+f4.

Rakeoff answered 26/8, 2014 at 7:22 Comment(0)
A
0

Setting IsTapEnabled, IsDoubleTapEnabled, IsRightTapEnabled, and IsHoldingEnabled to false should disable the gestures in the UI Element but they are properties, not methods. I haven't seen a method that will disable ALL gestures for a particular element.

I know it would be ridiculous to disable each control to respond to the gestures but if you need to disable all controls literally from Root to Children then creating an attach property on the root and setting these properties to false might be a solution.

Agrippina answered 14/9, 2012 at 20:48 Comment(1)
I'm not really trying to disable all gestures for an element. I'm trying to disable the OS level gestures. In Win8, you can perform certain gestures no matter the app and the OS will do certain things (show desktop, pin to left, etc). I need to trap/disable those OS level functions. So this really doesn't have anything to do with the controls on my page (and in fact, we'd love to let the users interact with touch with the controls in the app).Pinkie
F
0

The gestures are handled by explorer.exe. If your replace the windows shell (default: explorer.exe) with your Application, then there are no more gestures at the OS-level.

Registry keys:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows_NT\CurrentVersion\Winlogon\

Key: "Shell" (REG_SZ) = "path_to_your_application"

you can also do this only for the current user (HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows_NT\CurrentVersion\Winlogon)

Flanker answered 17/10, 2012 at 6:44 Comment(1)
if you want to disable gestures just for a metro app, what does the path look like?Danell
F
0

At least in 8.1, there appears to be a feature called Assigned Access:

http://blogs.technet.com/b/askpfeplat/archive/2013/10/28/how-to-setup-assigned-access-in-windows-8-1-kiosk-mode.aspx

http://windows.microsoft.com/en-us/windows-8/assigned-access

Settings > Change PC Settings > Accounts > Other Accounts > Set up an account for assigned access

Fortran answered 24/7, 2014 at 20:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.