How to make the Windows desktop on-screen keyboard open then minimise on startup and wake?

1

Like most people with "hybrid" touchscreen devices on Windows 8 or 8.1 (Windows 10 isn't an option for me right now for various reasons), I'm constantly annoyed by the "metro-style" on-screen keyboard popping up automatically even though I have an actual physical keyboard connected.

The best answer to this problem, without disabling the service completely (because I do sometimes use the device without a physical keyboard) is to open then minimise the old-school desktop-style on-screen keyboard. That application being open, even when minimised, stops the touchscreen metro-style keyboard popping up.

However, this also creates a (smaller) nuisance:

  • It's something I have to do every time I start up the computer
  • It un-minimises every time I put the computer to sleep, partially covering the lock screen, the picture password screen, and the Start screen.

Is there any way (bat script for example?) that I can make the onscreen keyboard open then minimise every time the computer starts up from shut down or from sleep?

user56reinstatemonica8

Posted 2015-11-10T09:57:56.137

Reputation: 3 946

If you know a bit about programming, I'm fairly confident you could do something with that. I'm not posing an answer because I don't actually know how, because I'm a novice at most desktop-based things, but I'm sure it's possible, even if it's just moving the mouse to the right position and clicking. – Fund Monica's Lawsuit – 2015-11-18T03:40:08.357

I think an Autohotkey script that automatically does the starting and minimising for you is a good solution. With Autohotkey you can click the mouse, and do keypresses, which combined make it possible for you to start and minimise the old-school desktopy-style on-screen keyboard. Adding this script to startup would make sure this goes automatically when starting. I am not sure whether or not you can use it to fix your lock-screen issue, opening and minimising something in lock-screen can be a challenge. Could you add a picture of that and exactly what you want fixed in this lock-screen? – BramMooij – 2015-11-23T09:45:44.047

@BramMooij Screenshots in lock screen don't work unfortunately. Basically, on turning it on from sleep, if the old-school on screen keyboard was minimised, the lock screen has that keyboard floating on top of everything. If I minimise it, it comes back on the picture-password screen. If I minimise it there too, it comes back on the start screen. Someone managed to screen grab it on the start screen, here's an example. It's not the end of the world, it's just a frequent annoyance.

– user56reinstatemonica8 – 2015-11-23T09:56:28.203

1Thanks for the extra info. I'll take a look when I have time and see if I can figure that one out. I think the easiest solution is to have a script run at startup to start and minimise the keyboard, and run another at shutdown that changes the setting to not use osk.exe after startup (which windows automatically changes after you start osk.exe). To add a program at shutdown go to "edit group policy->computer configuration->windows settings->scripts->shutdown. The start and minimise script will be easy, the change osk policy I don't know. – BramMooij – 2015-11-23T10:28:59.913

@BramMooij The Task Scheduler doesn't have an 'On workstation shutdown' event, but it does have a 'On workstation lock' that could be used to stop the osk using something like taskkill /IM osk.exe (elevation needed; also available via nircmd in nircmd elevate taskkill /IM osk.exe). – Kody Brown – 2015-11-26T18:38:12.647

@ Kody Brown. The method I described should work, though it is indeed not in the task scheduler and not as versatile as the task scheduler is. The problem is that killing the task is not enough, you have to change the settings of it automatically starting, otherwise it will start again when you start Windows. – BramMooij – 2015-11-27T13:17:03.153

Is a change of a Metro OnScreen Keyboard service to manual startup doesn't working?!? – g2mk – 2015-11-28T20:46:29.160

@g2mk No, if I change the service to Manual and/or stop the service, the moment I click or press on a text field in Chrome, Outlook etc, it starts the service and switches it back to "Automatic". The only setting it respects is "Disabled", but that prevents me bringing it up manually. – user56reinstatemonica8 – 2015-11-30T14:43:49.490

Answers

1

It sounds like BramMooij is onto a potential answer. I have an alternative suggestion that I have tested if his answer doesn't pan out.

First download nircmd if you don't already have it.

Create a batch file wherever you please and put the following code into it...

osk.exe
PING -n 3 127.0.0.1>nul
"locationOfNircmd\nircmd.exe" win hide title "On-Screen Keyboard"

Add the batch file to Task Scheduler as the action, and set the trigger as wake up from sleep or shutdown.

You may need to alter the "3" in the ping line depending on the performance of your computer, as osk sometimes takes a little while to appear in my testing (it is just a delay action in seconds). You will also need to replace LocationOfNircmd to where you copied those files. In my tests this task needs to be run as administrator in order to hide the keyboard.

Hayden Moulds

Posted 2015-11-10T09:57:56.137

Reputation: 79

Nice solution. I'm not sure it will work in the lock-screen though. It seems my ahk is on a dead end for now, so the OP might need a combination of our answers to get this to work. – BramMooij – 2015-11-23T11:10:04.350

1Alternatively, instead of using "PING -n 3 127.0.0.1>nul", you could use cmdwait, also included in the Nircmd package. Syntax: cmdwait xxxx where xxxx is the time in milliseconds. – BramMooij – 2015-11-23T12:12:30.567

OP, have you tried this on your lock screen? – Hayden Moulds – 2015-11-28T15:56:15.537

I've only just had time to properly try it out, looks promising. Can you add more detail about how to set up the Task Scheduler task so that it is triggered on wake from sleep or shutdown, and so it runs the script as administrator? Also, while the bat file does work, each time it brings up a NirCMD popup which is as annoying as the OSK - is there any way to prevent this from popping up? – user56reinstatemonica8 – 2015-11-30T14:36:13.363

Sorry I don't have access to a computer I am able to test this on at the moment as I'm travelling. The "Run as administrator" is on the first tab of the task properties if I remember correctly. The command should be able to be run minimised in the task options, but I forget the details of that. If you can't find it in 1 week I can help further and provide a vbs that runs the batch completely invisibly. – Hayden Moulds – 2015-12-01T01:31:54.883

1

I think I have a solution for your second problem.

Instead of getting rid of the osk window, you could change the position of the osk window to not be in your way. Open regedit, go to: HKEY_CURRENT_USER\Software\Microsoft\Osk.

Here you can set the WindowWidth, WindowHeight, and also WindowTop and WindowLeft. By changing the values for WindowTop and WindowLeft you can change the position. If you set both to 1 the osk window will start in the top left corner of your screen. You could use this to move the Window to a non-annoying position, then you only have the minimise after logon issue left.

I'm still working on the solution to your first problem. I made an autohotkey script to minimise the osk.exe window with a mouse click (assuming you know the position), but osk.exe acts different to most other programs. You cannot minimise it from the command line, and my autohotkey script can click everything but the osk window. It seems like the osk Window is sort of overlaying the rest causing the ahk mouseclick to disappear behind the window. I will try to figure this out and report back with the complete answer if I manage to find it.

BramMooij

Posted 2015-11-10T09:57:56.137

Reputation: 380