Sorry, I meant .NET CF 1.0. Here's an example:
using System;
using System.Drawing;
using System.Windows.Forms;
class MyControl: Control {}
class KeyTest {
static Label log;
static void Log (string msg) { log.Text += msg; }
static void KeyDown (object o, KeyEventArgs a) { Log("Down "); }
static void KeyPress (object o, KeyPressEventArgs a) { Log("Press
"); }
static void KeyUp (object o, KeyEventArgs a) { Log("Up\n"); }
static void Main () {
Form f = new Form();
f.Text = "KeyTest";
MyControl mc = new MyControl();
mc.Bounds = new Rectangle(0, 0, f.ClientSize.Width, 7);
mc.KeyDown += new KeyEventHandler(KeyDown);
mc.KeyPress += new KeyPressEventHandler(KeyPress);
mc.KeyUp += new KeyEventHandler(KeyUp);
f.Controls.Add(mc);
log = new Label();
log.Bounds = new Rectangle(0, mc.Height, f.ClientSize.Width,
f.ClientSize.Height - mc.Height);
f.Controls.Add(log);
Application.Run(f);
}
}
..NET CF 1.0 compiling and running it on a PC / PPC2003 / WM5 leads to
this:
one of the arrow keys => "Up"
alphabetical key => "Down Press Up"
alphabetical key hold => "Down Press Down Press ... Down Press Up"
while running it on a Smartphone 2003 leads to:
one of the arrow keys => "Down Up"
Any ideas?