1,105,386 Community Members

Use the On-Screen Keyboard

Member Avatar
Dani
The Queen of DaniWeb
20,568 posts since Feb 2002
Reputation Points: 1,356 [?]
Q&As Helped to Solve: 931 [?]
Skill Endorsements: 204 [?]
Administrator
Featured
Sponsor
 
0
 

I found this in a few different places around the 'net - hopefully it's helpful:

Use the On-Screen Keyboard

An on-screen keyboard is built into Windows XP. It can be useful if you have mobility impairments, if you are using a tablet PC, or if your keyboard breaks down unexpectedly.

To access the on-screen keyboard:

  • Go to Start, then click Run, and then type osk.

Now the keyboard opens on your computer screen, featuring three typing modes you can use to type data:

  • Clicking mode, where you click the on-screen keys.
  • Scanning mode, where you press a hot key or use a switch-input device to type highlighted characters.
  • Hovering mode, where you use a mouse or joystick to point to a key, which is then typed.

To make a shortcut icon on your desktop to the on-screen keyboard:

  • Right-click the desktop and choose New, then Shortcut.
  • Type osk, click Next.
  • Type a name for the shortcut, and then click Finish.
Member Avatar
johngnazzo
Newbie Poster
2 posts since May 2005
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Is there anyway to size the OSK application? I wish to integrate it with a touch screen and the keys are way too small .
Thanks,
JG

Member Avatar
avhunt
Newbie Poster
8 posts since Jun 2005
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

The XP onscreen keyboard is great, I've used it many times with learners. However on hi-res screens its tiny and I have not found and obvious tweaks to scale it. Longhorn (when it comes out) will sort the problem. I bet its possible to write a C++ routine and install it through the registry but that's rather scientific.

I got the screen res to 640 X 480 to alleviate the problem. The OSK is also problematic when you try to use the alt and control keys while scanning. It works fine though for simple text processing.
Rgds

Member Avatar
johngnazzo
Newbie Poster
2 posts since May 2005
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

ACTUALLY I was able to solve the problem :)

I can use the following code to RESIZE the Onscreen keyboard (OSK.exe) within my C# program. :idea:
Sample code follows:

using System.Runtime.InteropServices;
...


public class MyClass {



private const uint SWP_NOSIZE           = 0x0001;
private const uint SWP_NOMOVE           = 0x0002;
private const uint SWP_NOZORDER         = 0x0004;
private const uint SWP_NOREDRAW         = 0x0008;
private const uint SWP_NOACTIVATE       = 0x0010;
private const uint SWP_FRAMECHANGED     = 0x0020;
private const uint SWP_SHOWWINDOW       = 0x0040;
private const uint SWP_HIDEWINDOW       = 0x0080;
private const uint SWP_NOCOPYBITS       = 0x0100;
private const uint SWP_NOOWNERZORDER    = 0x0200;
private const uint SWP_NOSENDCHANGING   = 0x0400;


[DllImport("user32.dll")]
public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);


[DllImport("user32.dll")]
static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X,
int Y, int cx, int cy, uint uFlags);


[DllImport("user32.dll")]
static extern bool SetForegroundWindow(IntPtr hWnd);


......


private void showKeypad()
{


process = new Process();


process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.FileName = "c:\\winnt\\system32\\osk.exe";
process.StartInfo.Arguments = "";
process.StartInfo.WorkingDirectory = "c:\\";
process.Start();                                            // Start Onscreen Keyboard
process.WaitForInputIdle();


SetWindowPos( process.MainWindowHandle,
this.Handle,                         // Parent Window
this.Left,                            //  Keypad Position X
this.Top+20,                       //   Keypad Position Y
panelButtons.Width,             //    Keypad Width
panelButtons.Height,            //    Keypad Height
SWP_SHOWWINDOW | SWP_NOZORDER);  // Show Window and Place on Top


SetForegroundWindow(process.MainWindowHandle);
}
}
Member Avatar
nbt
Newbie Poster
1 post since May 2006
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

johngnazoo, thank you for your comments. I have been trying a find a solution to the OSK resize problem for a while. Although I am not much familiar with C#, I have vast experience with other languages. Could you please send me the complete code for the OSK resize. Some small tips on how to get it running would be useful too. I have tried to run your sample code without the "......" but could not get it to work.

Thanks!

ACTUALLY I was able to solve the problem :)

I can use the following code to RESIZE the Onscreen keyboard (OSK.exe) within my C# program. :idea:
Sample code follows:

using System.Runtime.InteropServices;
...

public class MyClass {


private const uint SWP_NOSIZE           = 0x0001;
private const uint SWP_NOMOVE           = 0x0002;
private const uint SWP_NOZORDER         = 0x0004;
private const uint SWP_NOREDRAW         = 0x0008;
private const uint SWP_NOACTIVATE       = 0x0010;
private const uint SWP_FRAMECHANGED     = 0x0020;
private const uint SWP_SHOWWINDOW       = 0x0040;
private const uint SWP_HIDEWINDOW       = 0x0080;
private const uint SWP_NOCOPYBITS       = 0x0100;
private const uint SWP_NOOWNERZORDER    = 0x0200;
private const uint SWP_NOSENDCHANGING   = 0x0400; 

[DllImport("user32.dll")]
public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);

[DllImport("user32.dll")]
static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X,
            int Y, int cx, int cy, uint uFlags);

[DllImport("user32.dll")]
static extern bool SetForegroundWindow(IntPtr hWnd);

......

private void showKeypad()
{
            
process = new Process();

process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.FileName = "c:\\winnt\\system32\\osk.exe";
process.StartInfo.Arguments = "";
process.StartInfo.WorkingDirectory = "c:\\";
process.Start();                                            // Start Onscreen Keyboard
process.WaitForInputIdle();
            
SetWindowPos( process.MainWindowHandle,
this.Handle,                         // Parent Window
this.Left,                            //  Keypad Position X
this.Top+20,                       //   Keypad Position Y
panelButtons.Width,             //    Keypad Width
panelButtons.Height,            //    Keypad Height
SWP_SHOWWINDOW | SWP_NOZORDER);  // Show Window and Place on Top

SetForegroundWindow(process.MainWindowHandle);
}        
}
Member Avatar
Wolverline
Newbie Poster
1 post since Mar 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I modified johngnazoo's source code and got it to work. It seems to be very interesting; but please know I'm a novice in C#/NET world.

Currently I can't get the size of window, positions and windows path, so I hardcoded them.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Diagnostics;

classWin32
{
[DllImport("user32.dll", EntryPoint = "SetWindowPos")]
public static extern bool SetWindowPos(
int hWnd, // window handle
int hWndInsertAfter, // placement-order handle
int X, // horizontal position
int Y, // vertical position
int cx, // width
int cy, // height
uint uFlags); // window positioning flags
public const int HWND_BOTTOM = 0x0001;
public const int HWND_TOP = 0x0000;
public const int SWP_NOSIZE = 0x0001;
public const int SWP_NOMOVE = 0x0002;
public const int SWP_NOZORDER = 0x0004;
public const int SWP_NOREDRAW = 0x0008;
public const int SWP_NOACTIVATE = 0x0010;
public const int SWP_FRAMECHANGED = 0x0020;
public const int SWP_SHOWWINDOW = 0x0040;
public const int SWP_HIDEWINDOW = 0x0080;
public const int SWP_NOCOPYBITS = 0x0100;
public const int SWP_NOOWNERZORDER = 0x0200;
public const int SWP_NOSENDCHANGING = 0x0400;
}
namespace OSKTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
showKeypad();
}

private void showKeypad()
{
Process process = new Process();
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.FileName = "c:\\WINDOWS\\system32\\osk.exe";
process.StartInfo.Arguments = "";
process.StartInfo.WorkingDirectory = "c:\\";
process.Start(); // Start Onscreen Keyboard
process.WaitForInputIdle();
Win32.SetWindowPos((int)process.MainWindowHandle,
Win32.HWND_BOTTOM,
300, 300, 800, 350,
Win32.SWP_SHOWWINDOW | Win32.SWP_NOZORDER);

}
}
}

johngnazoo, thank you for your comments. I have been trying a find a solution to the OSK resize problem for a while. Although I am not much familiar with C#, I have vast experience with other languages. Could you please send me the complete code for the OSK resize. Some small tips on how to get it running would be useful too. I have tried to run your sample code without the "......" but could not get it to work.

Thanks!

Member Avatar
vandanger
Newbie Poster
1 post since Nov 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

To resize the XP OSK:

I made a little utility in vb that you can download as an executable (with installer) from my website. If the keys go blank for any reason there's a reset button that'll fix it.

Member Avatar
jbennet
Moderator
17,127 posts since Apr 2005
Reputation Points: 1,618 [?]
Q&As Helped to Solve: 736 [?]
Skill Endorsements: 38 [?]
Team Colleague
Featured
 
0
 

I like the OSK. I wrote a small app that allows you to use a joystick as a keyboard/mouse so for text entry its good

Member Avatar
Kevin Waite
Newbie Poster
2 posts since Jan 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

I found this in a few different places around the 'net - hopefully it's helpful:

Use the On-Screen Keyboard

An on-screen keyboard is built into Windows XP. It can be useful if you have mobility impairments, if you are using a tablet PC, or if your keyboard breaks down unexpectedly.

To access the on-screen keyboard:

  • Go to Start, then click Run, and then type osk.

Now the keyboard opens on your computer screen, featuring three typing modes you can use to type data:

  • Clicking mode, where you click the on-screen keys.
  • Scanning mode, where you press a hot key or use a switch-input device to type highlighted characters.
  • Hovering mode, where you use a mouse or joystick to point to a key, which is then typed.

To make a shortcut icon on your desktop to the on-screen keyboard:

  • Right-click the desktop and choose New, then Shortcut.
  • Type osk, click Next.
  • Type a name for the shortcut, and then click Finish.

Hello, I have been using Microsoft's OSK.EXE (on screen keyboard) for several years now -- on a backup PC / print server etc. I only need a real keyboard to sign on into XP --- rats --- Does anyone know how to run OSK.EXE as part of system start boot/start up? So that OSK.EXE is running from the windows (XP) user login screen?
How is this solved for tablet PCs? Thanks in advance, Kevin Waite

Member Avatar
jbennet
Moderator
17,127 posts since Apr 2005
Reputation Points: 1,618 [?]
Q&As Helped to Solve: 736 [?]
Skill Endorsements: 38 [?]
Team Colleague
Featured
 
0
 

possibly. I know other accessibility stuff like high contrast, localisation, stickykeys etc.... works for logging in so maybe its possible.

A malicious user could theoretically replace osk.exe with something else which could then capture passwords though,so i dont know if xp will allow it

Member Avatar
The Dude
Nearly a Senior Poster
3,430 posts since Dec 2005
Reputation Points: 944 [?]
Q&As Helped to Solve: 78 [?]
Skill Endorsements: 0 [?]
 
0
 

When i saw this thread i was wondering what the name of OSK was and i saw it listed a few replies down :)

OSK.EXE

Might try to ifnd this and run it on my computer just for fun :)

EDIT:

I googled and found a link to DL this @ (Its pretty small (Ah man!!))

Member Avatar
muraliavn
Newbie Poster
2 posts since Feb 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I found this in a few different places around the 'net - hopefully it's helpful:

Use the On-Screen Keyboard

An on-screen keyboard is built into Windows XP. It can be useful if you have mobility impairments, if you are using a tablet PC, or if your keyboard breaks down unexpectedly.

To access the on-screen keyboard:

  • Go to Start, then click Run, and then type osk.

Now the keyboard opens on your computer screen, featuring three typing modes you can use to type data:

  • Clicking mode, where you click the on-screen keys.
  • Scanning mode, where you press a hot key or use a switch-input device to type highlighted characters.
  • Hovering mode, where you use a mouse or joystick to point to a key, which is then typed.

To make a shortcut icon on your desktop to the on-screen keyboard:

  • Right-click the desktop and choose New, then Shortcut.
  • Type osk, click Next.
  • Type a name for the shortcut, and then click Finish.

This is Murali from Chennai (India) I want small help from you i.e. control the "On Screen Keyboard" with program (code). How will I contact you. Pls help me in this problem...

Thanking you.
Murali A

Member Avatar
muraliavn
Newbie Poster
2 posts since Feb 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

This is Murali from Chennai (India) I want small help from you i.e. control the "On Screen Keyboard" with program (code). How will I contact you. My mail id (muraliavnprofile@gmail.com) "muraliavnprofile at gmail dot com" Pls help me in this problem...

Thanking you.
Murali A

Member Avatar
baxterbaker
Newbie Poster
6 posts since Feb 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

thanks for sharing this useful knowledge with us.

Member Avatar
Tanha Karim
Light Poster
40 posts since Feb 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Nice Sharing

Member Avatar
softhari
Newbie Poster
1 post since Sep 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

The on screen keyboard has many uses as mentioned above and one of its main use was that Microsoft was aware of hackers even at that time. So in order not to fall in their traps i.e by using our original keyboard they put forward the on screen keyboard so that the hackers wouldn't know what you are typing on your keyboard because on screen keyboard basically relies on mouse clicks. As most of the hackers use key loggers on screen keyboard prohibits or in other words makes it impossible to let them track our user names passwords bank account numbers and many more. So thats it about the on screen keyboard.
Thank you.
If you have any queries regarding problems on your pc then let me know at the given email address-
softhari@gmail.com

Member Avatar
naushad84
Newbie Poster
1 post since Jan 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi,

using the above code I am able to resize the OSK in Win XP but it' s not working in Windows 7.

Can anyone help me to solve this problem.

Thanks

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: