home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!psgrain!hippo!ford.ee.up.ac.za!carr.up.ac.za!carr
- From: carr@scinet.up.ac.za (Alan Carr)
- Subject: Trapping keyboard events from owl
- Sender: news@ford.ee.up.ac.za (NetNews Daemon)
- Message-ID: <carr.14.716027682@scinet.up.ac.za>
- Date: Wed, 9 Sep 1992 08:34:42 GMT
- Lines: 30
- Organization: University of Pretoria
- Keywords: BC++ 3.1
-
- I have created a class based on TEdit which defines the two methods,
- one to trap the Enter key, the other to allow only numerical values
- through:
- .
- .
- virtual void NumOnly(RTMessage Msg) = [WM_CHAR];
- virtual void HandleEnter(RTMessage Msg) = [WM_KEYUP];
- .
- .
- void XX::NumOnly(RTMessage Msg) {
- if(isfloat(Msg.WParam))
- .
- else
- MessageBeep(0)
- }
- void XX::HandleReturn(RTMessage Msg) {
- if(Msg.WParam == VK_RETURN)
- .
- .
- }
- Queries:
- 1) Shouldn't WM_CHAR also trap Enter, Tab, F-keys, BS etc ?
- 2) Can these keys be trapped in a way other than my WM_KEYUP
- method ?
- 3) Is there a simple way (ie without flags) of trapping Ctrl- and
- Shift-key sequences, including Ctrl-Enter & Shift-Enter ??
-
- thanks
- alan carr
- email: carr@scinet.up.ac.za
-