Panda3D
pgMouseWatcherBackground.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file pgMouseWatcherBackground.h
10  * @author drose
11  * @date 2001-08-23
12  */
13 
14 #ifndef PGMOUSEWATCHERBACKGROUND_H
15 #define PGMOUSEWATCHERBACKGROUND_H
16 
17 #include "pandabase.h"
18 
19 #include "mouseWatcherRegion.h"
20 
21 /**
22  * This is a special kind of MouseWatcherRegion that doesn't have a rectangle
23  * and is never active, but just quietly listens for keypresses and sends them
24  * to all the PGItems with background focus.
25  */
26 class EXPCL_PANDA_PGUI PGMouseWatcherBackground : public MouseWatcherRegion {
27 PUBLISHED:
29  virtual ~PGMouseWatcherBackground();
30 
31 public:
32  virtual void press(const MouseWatcherParameter &param);
33  virtual void release(const MouseWatcherParameter &param);
34  virtual void keystroke(const MouseWatcherParameter &param);
35  virtual void candidate(const MouseWatcherParameter &param);
36 
37 public:
38  static TypeHandle get_class_type() {
39  return _type_handle;
40  }
41  static void init_type() {
42  MouseWatcherRegion::init_type();
43  register_type(_type_handle, "PGMouseWatcherBackground",
44  MouseWatcherRegion::get_class_type());
45  }
46  virtual TypeHandle get_type() const {
47  return get_class_type();
48  }
49  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
50 
51 private:
52  static TypeHandle _type_handle;
53 };
54 
55 #endif
virtual void release(const MouseWatcherParameter &param)
This is a callback hook function, called whenever a mouse or keyboard button previously depressed wit...
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void press(const MouseWatcherParameter &param)
This is a callback hook function, called whenever a mouse or keyboard button is depressed while the m...
virtual void candidate(const MouseWatcherParameter &param)
This is a callback hook function, called whenever an IME candidate is highlighted by the user.
This is the class that defines a rectangular region on the screen for the MouseWatcher.
virtual void keystroke(const MouseWatcherParameter &param)
This is a callback hook function, called whenever a keystroke is generated by the user.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
This is sent along as a parameter to most events generated for a region to indicate the mouse and but...
This is a special kind of MouseWatcherRegion that doesn't have a rectangle and is never active,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.