mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
initial add
This commit is contained in:
parent
6180335879
commit
be7a26dd12
42
panda/src/awesomium/AwMouseAndKeyboard.cxx
Normal file
42
panda/src/awesomium/AwMouseAndKeyboard.cxx
Normal file
@ -0,0 +1,42 @@
|
||||
// Filename: AwMouseAndKeyboard.cxx
|
||||
// Created by: Bei Yang (Mar2010)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) Carnegie Mellon University. All rights reserved.
|
||||
//
|
||||
// All use of this software is subject to the terms of the revised BSD
|
||||
// license. You should have received a copy of this license along
|
||||
// with this source code in a file named "LICENSE."
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "config_awesomium.h"
|
||||
#include "AwMouseAndKeyboard.h"
|
||||
#include "dataNodeTransmit.h"
|
||||
|
||||
TypeHandle AwMouseAndKeyboard::_type_handle;
|
||||
|
||||
AwMouseAndKeyboard::AwMouseAndKeyboard(GraphicsWindow *window, int device, const string &name):
|
||||
MouseAndKeyboard(window,device,name)
|
||||
{
|
||||
//do nothing
|
||||
}
|
||||
|
||||
|
||||
void AwMouseAndKeyboard::do_transmit_data(DataGraphTraverser *trav, const DataNodeTransmit &input, DataNodeTransmit &output){
|
||||
|
||||
MouseAndKeyboard::do_transmit_data(trav,input,output);
|
||||
|
||||
int num_events = _button_events->get_num_events();
|
||||
for (int i = 0; i < num_events; i++) {
|
||||
const ButtonEvent &be = _button_events->get_event(i);
|
||||
string event_name = be._button.get_name();
|
||||
printf("Button pressed: %s ", event_name);
|
||||
if(be._type == ButtonEvent::T_down ) printf(" down ");
|
||||
if(be._type == ButtonEvent::T_repeat ) printf(" repeat ");
|
||||
if(be._type == ButtonEvent::T_resume_down ) printf(" resume down ");
|
||||
if(be._type == ButtonEvent::T_resume_down ) printf(" up ");
|
||||
}
|
||||
}
|
56
panda/src/awesomium/AwMouseAndKeyboard.h
Normal file
56
panda/src/awesomium/AwMouseAndKeyboard.h
Normal file
@ -0,0 +1,56 @@
|
||||
// Filename: awWebCore.h
|
||||
// Created by: rurbino (12Oct09)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) Carnegie Mellon University. All rights reserved.
|
||||
//
|
||||
// All use of this software is subject to the terms of the revised BSD
|
||||
// license. You should have received a copy of this license along
|
||||
// with this source code in a file named "LICENSE."
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
#ifndef AWWEBKEYBOARDMOUSE_H
|
||||
#define AWWEBKEYBOARDMOUSE_H
|
||||
|
||||
#include "pandabase.h"
|
||||
#include "typedReferenceCount.h"
|
||||
#include "luse.h"
|
||||
|
||||
#include "mouseAndKeyboard.h"
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Class : AwMouseAndKeyboard
|
||||
// Description : Thin wrappings arround WebCore.h
|
||||
////////////////////////////////////////////////////////////////////
|
||||
class EXPCL_PANDAAWESOMIUM AwMouseAndKeyboard : public MouseAndKeyboard {
|
||||
PUBLISHED:
|
||||
AwMouseAndKeyboard(GraphicsWindow *window, int device, const string &name);
|
||||
|
||||
protected:
|
||||
// Inherited from DataNode
|
||||
virtual void do_transmit_data(DataGraphTraverser *trav,
|
||||
const DataNodeTransmit &input,
|
||||
DataNodeTransmit &output);
|
||||
|
||||
public:
|
||||
static TypeHandle get_class_type() {
|
||||
return _type_handle;
|
||||
}
|
||||
static void init_type() {
|
||||
MouseAndKeyboard::init_type();
|
||||
register_type(_type_handle, "AwMouseAndKeyboard",
|
||||
MouseAndKeyboard::get_class_type());
|
||||
}
|
||||
virtual TypeHandle get_type() const {
|
||||
return get_class_type();
|
||||
}
|
||||
virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
|
||||
|
||||
private:
|
||||
static TypeHandle _type_handle;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user