Mouse event handling and keyboard event handling (not totally working yet)

This commit is contained in:
Heilig Benedek 2015-08-31 18:32:33 +02:00
parent e4c01f3187
commit c59c0bd5b3
9 changed files with 330 additions and 3 deletions

View file

@ -0,0 +1,45 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/common/event_types.h"
namespace atom {
namespace event_types {
const char kMouseDown[] = "down";
const char kMouseUp[] = "up";
const char kMouseMove[] = "move";
const char kMouseEnter[] = "enter";
const char kMouseLeave[] = "leave";
const char kContextMenu[] = "context-menu";
const char kMouseWheel[] = "wheel";
const char kKeyDown[] = "key-down";
const char kKeyUp[] = "key-up";
const char kChar[] = "char";
const char kMouseLeftButton[] = "left";
const char kMouseRightButton[] = "right";
const char kMouseMiddleButton[] = "middle";
const char kModifierLeftButtonDown[] = "left-button-down";
const char kModifierMiddleButtonDown[] = "middle-button-down";
const char kModifierRightButtonDown[] = "right-button-down";
const char kModifierShiftKey[] = "shift";
const char kModifierControlKey[] = "control";
const char kModifierAltKey[] = "alt";
const char kModifierMetaKey[] = "meta";
const char kModifierCapsLockOn[] = "caps-lock";
const char kModifierNumLockOn[] = "num-lock";
const char kModifierIsKeyPad[] = "keypad";
const char kModifierIsAutoRepeat[] = "auto-repeat";
const char kModifierIsLeft[] = "left";
const char kModifierIsRight[] = "right";
} // namespace switches
} // namespace atom

48
atom/common/event_types.h Normal file
View file

@ -0,0 +1,48 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_COMMON_EVENT_TYPES_H_
#define ATOM_COMMON_EVENT_TYPES_H_
namespace atom {
namespace event_types {
extern const char kMouseDown[];
extern const char kMouseUp[];
extern const char kMouseMove[];
extern const char kMouseEnter[];
extern const char kMouseLeave[];
extern const char kContextMenu[];
extern const char kMouseWheel[];
extern const char kKeyDown[];
extern const char kKeyUp[];
extern const char kChar[];
extern const char kMouseLeftButton[];
extern const char kMouseRightButton[];
extern const char kMouseMiddleButton[];
extern const char kModifierLeftButtonDown[];
extern const char kModifierMiddleButtonDown[];
extern const char kModifierRightButtonDown[];
extern const char kModifierShiftKey[];
extern const char kModifierControlKey[];
extern const char kModifierAltKey[];
extern const char kModifierMetaKey[];
extern const char kModifierCapsLockOn[];
extern const char kModifierNumLockOn[];
extern const char kModifierIsKeyPad[];
extern const char kModifierIsAutoRepeat[];
extern const char kModifierIsLeft[];
extern const char kModifierIsRight[];
} // namespace switches
} // namespace atom
#endif // ATOM_COMMON_EVENT_TYPES_H_

View file

@ -112,6 +112,16 @@ const char kAppUserModelId[] = "app-user-model-id";
const char kOffScreenRender[] = "offscreen-render";
const char kModifiers[] = "modifiers";
const char kKeyCode[] = "keycode";
const char kMovementX[] = "movement-x";
const char kMovementY[] = "movement-y";
const char kClickCount[] = "click-count";
const char kMouseEventType[] = "type";
const char kMouseEventButton[] = "button";
const char kMouseWheelPrecise[] = "precise";
} // namespace switches
} // namespace atom

View file

@ -62,6 +62,16 @@ extern const char kAppUserModelId[];
extern const char kOffScreenRender[];
extern const char kModifiers[];
extern const char kKeyCode[];
extern const char kMovementX[];
extern const char kMovementY[];
extern const char kClickCount[];
extern const char kMouseEventType[];
extern const char kMouseEventButton[];
extern const char kMouseWheelPrecise[];
} // namespace switches
} // namespace atom