summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/gtk/KeyEventGtk.cpp
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2008-10-21 07:00:00 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2008-10-21 07:00:00 -0700
commit9364f22aed35e1a1e9d07c121510f80be3ab0502 (patch)
treed49911209b132da58d838efa852daf28d516df21 /WebCore/platform/gtk/KeyEventGtk.cpp
parent87eb0cb35bad8784770ebc807e6c982432e47107 (diff)
downloadexternal_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.zip
external_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.tar.gz
external_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.tar.bz2
Initial Contribution
Diffstat (limited to 'WebCore/platform/gtk/KeyEventGtk.cpp')
-rw-r--r--WebCore/platform/gtk/KeyEventGtk.cpp25
1 files changed, 4 insertions, 21 deletions
diff --git a/WebCore/platform/gtk/KeyEventGtk.cpp b/WebCore/platform/gtk/KeyEventGtk.cpp
index dea0502..5d2efcf 100644
--- a/WebCore/platform/gtk/KeyEventGtk.cpp
+++ b/WebCore/platform/gtk/KeyEventGtk.cpp
@@ -2,7 +2,6 @@
* Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
* Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
* Copyright (C) 2007 Holger Hans Peter Freyther
- * Copyright (C) 2008 Collabora, Ltd. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,13 +29,13 @@
#include "config.h"
#include "PlatformKeyboardEvent.h"
+#include "DeprecatedString.h"
#include "KeyboardCodes.h"
#include "NotImplemented.h"
#include "TextEncoding.h"
#include <gdk/gdk.h>
#include <gdk/gdkkeysyms.h>
-#include <gtk/gtkversion.h>
namespace WebCore {
@@ -485,8 +484,6 @@ static String singleCharacterString(guint val)
return retVal;
}
-// Keep this in sync with the other platform event constructors
-// TODO: m_gdkEventKey should be refcounted
PlatformKeyboardEvent::PlatformKeyboardEvent(GdkEventKey* event)
: m_type((event->type == GDK_KEY_RELEASE) ? KeyUp : KeyDown)
, m_text(singleCharacterString(event->keyval))
@@ -494,29 +491,20 @@ PlatformKeyboardEvent::PlatformKeyboardEvent(GdkEventKey* event)
, m_keyIdentifier(keyIdentifierForGdkKeyCode(event->keyval))
, m_autoRepeat(false)
, m_windowsVirtualKeyCode(windowsKeyCodeForKeyEvent(event->keyval))
- , m_isKeypad(event->keyval >= GDK_KP_Space && event->keyval <= GDK_KP_9)
+ , m_isKeypad(false)
, m_shiftKey((event->state & GDK_SHIFT_MASK) || (event->keyval == GDK_3270_BackTab))
, m_ctrlKey(event->state & GDK_CONTROL_MASK)
, m_altKey(event->state & GDK_MOD1_MASK)
-#if GTK_CHECK_VERSION(2,10,0)
- , m_metaKey(event->state & GDK_META_MASK)
-#else
- // GDK_MOD2_MASK doesn't always mean meta so we can't use it
- , m_metaKey(false)
-#endif
- , m_gdkEventKey(event)
+ , m_metaKey(event->state & GDK_MOD2_MASK)
{
}
-void PlatformKeyboardEvent::disambiguateKeyDownEvent(Type type, bool backwardCompatibilityMode)
+void PlatformKeyboardEvent::disambiguateKeyDownEvent(Type type, bool)
{
// Can only change type from KeyDown to RawKeyDown or Char, as we lack information for other conversions.
ASSERT(m_type == KeyDown);
m_type = type;
- if (backwardCompatibilityMode)
- return;
-
if (type == RawKeyDown) {
m_text = String();
m_unmodifiedText = String();
@@ -532,9 +520,4 @@ bool PlatformKeyboardEvent::currentCapsLockState()
return false;
}
-GdkEventKey* PlatformKeyboardEvent::gdkEventKey() const
-{
- return m_gdkEventKey;
-}
-
}