home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / mswindo / programm / misc / 1741 < prev    next >
Encoding:
Text File  |  1992-09-08  |  1.2 KB  |  42 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!psgrain!hippo!ford.ee.up.ac.za!carr.up.ac.za!carr
  3. From: carr@scinet.up.ac.za (Alan Carr)
  4. Subject: Trapping keyboard events from owl
  5. Sender: news@ford.ee.up.ac.za (NetNews Daemon)
  6. Message-ID: <carr.14.716027682@scinet.up.ac.za>
  7. Date: Wed, 9 Sep 1992 08:34:42 GMT
  8. Lines: 30
  9. Organization: University of Pretoria
  10. Keywords: BC++ 3.1
  11.  
  12. I have created a class based on TEdit which defines the two methods,
  13. one to trap the Enter key, the other to allow only numerical values
  14. through:
  15.     .
  16.     .
  17.     virtual void NumOnly(RTMessage Msg) = [WM_CHAR];
  18.     virtual void HandleEnter(RTMessage Msg) = [WM_KEYUP];
  19.     .
  20.     .
  21.     void XX::NumOnly(RTMessage Msg) {
  22.         if(isfloat(Msg.WParam))
  23.         .
  24.         else
  25.             MessageBeep(0)
  26.     }
  27.     void XX::HandleReturn(RTMessage Msg) {
  28.         if(Msg.WParam == VK_RETURN)
  29.         .
  30.         .
  31.     }
  32. Queries:
  33.     1) Shouldn't WM_CHAR also trap Enter, Tab, F-keys, BS etc ?
  34.     2) Can these keys be trapped in a way other than my WM_KEYUP
  35. method ?
  36.     3) Is there a simple way (ie without flags) of trapping Ctrl- and
  37. Shift-key sequences, including Ctrl-Enter & Shift-Enter ??
  38.  
  39. thanks
  40. alan carr   
  41. email: carr@scinet.up.ac.za
  42.