+// -*- C++ -*-
/**
* \file qlkey.h
- * Copyright 2002 the LyX Team
- * Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
*
- * \author John Levon <moz@compsoc.man.ac.uk>
+ * \author John Levon
+ *
+ * Full author contact details are available in file CREDITS
*/
#ifndef QLKEY_H
#define QLKEY_H
-
-#include <config.h>
-#include <qnamespace.h>
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+#include <qnamespace.h>
#include "LString.h"
-#include "debug.h"
-
+
/**
* Return true if the key event is a modifier.
*/
case Qt::Key_Alt:
return true;
- // AltGr becomes Key_Unknown on at least one keyboard
- case Qt::Key_Unknown:
+ // AltGr becomes Key_unknown on at least one keyboard
+ case Qt::Key_unknown:
return true;
}
return false;
}
-
+
/**
* Return the numeric Qt Key corresponding to the
* given symbol name.
*/
int string_to_qkey(string const & str)
{
+ // FIX! (Lgb)
+
if (str == "Escape") return Qt::Key_Escape;
if (str == "Tab") return Qt::Key_Tab;
if (str == "BackSpace") return Qt::Key_BackSpace;
if (str == "Return") return Qt::Key_Return;
if (str == "KP_Enter") return Qt::Key_Enter; // correct ?
if (str == "Insert") return Qt::Key_Insert;
+ if (str == "KP_Insert") return Qt::Key_Insert;
if (str == "Delete") return Qt::Key_Delete;
+ if (str == "KP_Delete") return Qt::Key_Delete;
if (str == "Pause") return Qt::Key_Pause;
if (str == "Print") return Qt::Key_Print;
if (str == "Sys_Req") return Qt::Key_SysReq;
if (str == "Down") return Qt::Key_Down;
if (str == "Prior") return Qt::Key_Prior;
if (str == "Next") return Qt::Key_Next;
+ if (str == "KP_Home") return Qt::Key_Home;
+ if (str == "KP_End") return Qt::Key_End;
+ if (str == "KP_Left") return Qt::Key_Left;
+ if (str == "KP_Up") return Qt::Key_Up;
+ if (str == "KP_Right") return Qt::Key_Right;
+ if (str == "KP_Down") return Qt::Key_Down;
+ if (str == "KP_Prior") return Qt::Key_Prior;
+ if (str == "KP_Next") return Qt::Key_Next;
if (str == "Shift_L") return Qt::Key_Shift;
if (str == "Control_L") return Qt::Key_Control;
if (str == "Alt_L") return Qt::Key_Meta; // correct ?
if (str == "thorn") return Qt::Key_thorn;
if (str == "ydiaeresis") return Qt::Key_ydiaeresis;
- // FIXME, correct for all these ?
+ // FIXME, correct for all these ?
if (str == "Super_L") return Qt::Key_Super_L;
if (str == "Super_R") return Qt::Key_Super_R;
if (str == "Menu") return Qt::Key_Menu;
if (str == "Help") return Qt::Key_Help;
if (str == "Bar") return Qt::Key_Bar;
if (str == "BackTab") return Qt::Key_Backtab;
-
+
return Qt::Key_unknown;
}
-
+
/**
* qkey_to_string - convert Qt keypress into LyX
*