Ecere SDK/eC Forums
http://www.ecere.com/forums/
Print view

按ECS退出(exit on escape)
http://www.ecere.com/forums/viewtopic.php?f=30&t=38
Page 1 of 1
Author:  liqi98136 [ Wed Mar 10, 2010 8:31 am ]
Post subject:  按ECS退出(exit on escape)

Code: Select all

import "ecere"

class Form1 : Window
{
   text = "例子:按ECS退出";
   background = black;
   borderStyle = sizable;
   hasClose = true;
   size = { 640, 480 };
   
   bool OnKeyDown(Key key, unichar ch)
   {
      switch(key)
      {
      case escape: 
            Destroy(0); 
            return false; 
      }
      return true;
   }
}

Form1 form1 {};
All times are UTC-05:00 Page 1 of 1