[DEBUG] corection of some error in the X11 abstraction and key event french name

This commit is contained in:
Edouard DUPIN 2012-12-04 23:27:08 +01:00
parent ae29b34eab
commit 6de53cf3f2
9 changed files with 189 additions and 134 deletions

2
build

@ -1 +1 @@
Subproject commit a4e1c141f04e96da02edfa64644a85ab332eadad Subproject commit 0e65c531e58f33dbacc59ebeb4d41dd279cafc90

2
external/etk vendored

@ -1 +1 @@
Subproject commit a44667d4566066767a7961dde989a661c932943e Subproject commit 1d4c27e7fd68cb9cbf11a89068c4b1d10744555c

View File

@ -46,7 +46,7 @@ static const char* keyboardDescriptionString[ewol::keyEvent::keyboardCount+1] =
"keyboardPageDown", "keyboardPageDown",
"keyboardStart", "keyboardStart",
"keyboardEnd", "keyboardEnd",
"keyboardCenter", "keyboardPrint",
"keyboardStopDefil", "keyboardStopDefil",
"keyboardWait", "keyboardWait",
"keyboardInsert", "keyboardInsert",
@ -72,7 +72,7 @@ static const char* keyboardDescriptionString[ewol::keyEvent::keyboardCount+1] =
"keyboardAlt", "keyboardAlt",
"keyboardAltGr", "keyboardAltGr",
"keyboardContextMenu", "keyboardContextMenu",
"keyboardVerNum", "keyboardNumLock",
"keyboardCount" "keyboardCount"
}; };
@ -111,3 +111,64 @@ ewol::SpecialKey& ewol::GetCurrentSpecialKeyStatus(void)
{ {
return l_LocalKeyStatus; return l_LocalKeyStatus;
} }
ewol::SpecialKey::SpecialKey(void) :
value(0)
{
}
bool ewol::SpecialKey::IsSetCapsLock(void)
{
return capLock;
}
bool ewol::SpecialKey::IsSetShift(void)
{
return shift;
}
bool ewol::SpecialKey::IsSetCtrl(void)
{
return ctrl;
}
bool ewol::SpecialKey::IsSetMeta(void)
{
return meta;
}
bool ewol::SpecialKey::IsSetAlt(void)
{
return alt;
}
bool ewol::SpecialKey::IsSetAltGr(void)
{
return altGr;
}
bool ewol::SpecialKey::IsSetNumLock(void)
{
return numLock;
}
bool ewol::SpecialKey::IsSetInsert(void)
{
return insert;
}
etk::CCout& ewol::operator <<(etk::CCout &os, const ewol::SpecialKey obj)
{
os << " capLock=" << obj.capLock;
os << " shift=" << obj.shift;
os << " ctrl=" << obj.ctrl;
os << " meta=" << obj.meta;
os << " alt=" << obj.alt;
os << " altGr=" << obj.altGr;
os << " verNum=" << obj.numLock;
os << " insert=" << obj.insert;
return os;
}

View File

@ -20,11 +20,11 @@ namespace ewol
* @brief type of input : Note that the keyboard is not prevent due to the fact that data is too different * @brief type of input : Note that the keyboard is not prevent due to the fact that data is too different
*/ */
typedef enum { typedef enum {
typeUnknow = 0, typeUnknow = 0, //!< Unknow input Type
typeMouse, typeMouse, //!< Mouse type
typeFinger, typeFinger, //!< Finger type
typeStylet, typeStylet, //!< Stylet type
typeCount typeCount //!< number of types
} type_te; } type_te;
/** /**
* @brief Debug operator To display the curent element in a Human redeable information * @brief Debug operator To display the curent element in a Human redeable information
@ -57,43 +57,43 @@ namespace ewol
* @brief Keybord event or joyestick event * @brief Keybord event or joyestick event
*/ */
typedef enum { typedef enum {
keyboardUnknow = 0, keyboardUnknow = 0, //!< Unknown keyboard key
keyboardLeft, keyboardLeft, //!< Left key <--
keyboardRight, keyboardRight, //!< Right key -->
keyboardUp, keyboardUp, //!< Up key ^
keyboardDown, keyboardDown, //!< Down key \/
keyboardPageUp, keyboardPageUp, //!< Page Up key
keyboardPageDown, keyboardPageDown, //!< page down key
keyboardStart, keyboardStart, //!< Start key
keyboardEnd, keyboardEnd, //!< End key
keyboardCenter, keyboardPrint, //!< Print screen key.
keyboardStopDefil, keyboardStopDefil, //!< Stop display key.
keyboardWait, keyboardWait, //!< Wait key.
keyboardInsert, keyboardInsert, //!< Insert key.
keyboardF1, keyboardF1, //!< F1 key.
keyboardF2, keyboardF2, //!< F2 key.
keyboardF3, keyboardF3, //!< F3 key.
keyboardF4, keyboardF4, //!< F4 key.
keyboardF5, keyboardF5, //!< F5 key.
keyboardF6, keyboardF6, //!< F6 key.
keyboardF7, keyboardF7, //!< F7 key.
keyboardF8, keyboardF8, //!< F8 key.
keyboardF9, keyboardF9, //!< F9 key.
keyboardF10, keyboardF10, //!< F10 key.
keyboardF11, keyboardF11, //!< F11 key.
keyboardF12, keyboardF12, //!< F12 key.
keyboardCapLock, keyboardCapLock, //!< Capital Letter Lock key.
keyboardShiftLeft, keyboardShiftLeft, //!< Shift left key.
keyboardShiftRight, keyboardShiftRight, //!< Shift right key.
keyboardCtrlLeft, keyboardCtrlLeft, //!< Control left key.
keyboardCtrlRight, keyboardCtrlRight, //!< Control right key.
keyboardMetaLeft, keyboardMetaLeft, //!< Meta left key (apple key or windows key).
keyboardMetaRight, keyboardMetaRight, //!< Meta right key (apple key or windows key).
keyboardAlt, keyboardAlt, //!< Alt key.
keyboardAltGr, keyboardAltGr, //!< Alt ground key.
keyboardContextMenu, keyboardContextMenu, //!< Contextual menu key.
keyboardVerNum, keyboardNumLock, //!< Numerical Lock key.
keyboardCount keyboardCount //!< number of posible key
} keyboard_te; } keyboard_te;
/** /**
* @brief Debug operator To display the curent element in a Human redeable information * @brief Debug operator To display the curent element in a Human redeable information
@ -113,54 +113,60 @@ namespace ewol
unsigned meta : 1; unsigned meta : 1;
unsigned alt : 1; unsigned alt : 1;
unsigned altGr : 1; unsigned altGr : 1;
unsigned verNum : 1; unsigned numLock : 1;
unsigned insert : 1; unsigned insert : 1;
}; };
}; };
SpecialKey(void) : public:
value(0) /**
{ * @brief Main constructor
*/
} SpecialKey(void);
bool IsSetCapsLock(void) /**
{ * @brief Get the current CapLock Status
return capLock; * @return The status value
} */
bool IsSetCapsLock(void);
bool IsSetShift(void) /**
{ * @brief Get the current Shift key status
return shift; * @return The status value
} */
bool IsSetShift(void);
bool IsSetCtrl(void) /**
{ * @brief Get the Current Control key status
return ctrl; * @return The status value
} */
bool IsSetCtrl(void);
bool IsSetMeta(void) /**
{ * @brief Get the current Meta key status (also named windows or apple key)
return meta; * @return The status value
} */
bool IsSetMeta(void);
bool IsSetAlt(void) /**
{ * @brief Get the current Alt key status
return alt; * @return The status value
} */
bool IsSetAlt(void);
bool IsSetAltGr(void) /**
{ * @brief Get the current Alt-Gr key status
return altGr; * @return The status value
} */
bool IsSetAltGr(void);
bool IsSetVerNum(void) /**
{ * @brief Get the current Ver-num key status
return verNum; * @return The status value
} */
bool IsSetInsert(void) bool IsSetNumLock(void);
{ /**
return insert; * @brief Get the current Intert key status
} * @return The status value
*/
bool IsSetInsert(void);
}; };
/**
* @brief Debug operator To display the curent element in a Human redeable information
*/
etk::CCout& operator <<(etk::CCout &os, const ewol::SpecialKey obj);
SpecialKey& GetCurrentSpecialKeyStatus(void); SpecialKey& GetCurrentSpecialKeyStatus(void);
}; };

View File

@ -129,13 +129,13 @@ void ewolProcessEvents(void)
l_managementInput.State(data.inputType, data.inputId, data.stateIsDown, data.dimention); l_managementInput.State(data.inputType, data.inputId, data.stateIsDown, data.dimention);
break; break;
case THREAD_KEYBORAD_KEY: case THREAD_KEYBORAD_KEY:
//EWOL_DEBUG("Receive MSG : THREAD_KEYBORAD_KEY"); case THREAD_KEYBORAD_MOVE:
EWOL_DEBUG("Receive MSG : THREAD_KEYBORAD_KEY");
{ {
ewol::SpecialKey& specialCurrentKey = ewol::GetCurrentSpecialKeyStatus(); ewol::SpecialKey& specialCurrentKey = ewol::GetCurrentSpecialKeyStatus();
specialCurrentKey = data.keyboardSpecial; specialCurrentKey = data.keyboardSpecial;
EWOL_DEBUG("newStatus Key" << specialCurrentKey);
} }
// no break ... (normal case ...)
case THREAD_KEYBORAD_MOVE:
if (NULL != windowsCurrent) { if (NULL != windowsCurrent) {
if (false==windowsCurrent->OnEventShortCut(data.keyboardSpecial, if (false==windowsCurrent->OnEventShortCut(data.keyboardSpecial,
data.keyboardChar, data.keyboardChar,

View File

@ -790,9 +790,9 @@ void X11_Run(void)
} }
if (event.xkey.state & (1<<4) ) { if (event.xkey.state & (1<<4) ) {
//EWOL_DEBUG(" Special Key : VER_num"); //EWOL_DEBUG(" Special Key : VER_num");
guiKeyBoardMode.verNum = true; guiKeyBoardMode.numLock = true;
} else { } else {
guiKeyBoardMode.verNum = false; guiKeyBoardMode.numLock = false;
} }
if (event.xkey.state & (1<<5) ) { if (event.xkey.state & (1<<5) ) {
EWOL_DEBUG(" Special Key : MOD"); EWOL_DEBUG(" Special Key : MOD");
@ -864,10 +864,14 @@ void X11_Run(void)
case 64: keyInput = ewol::keyEvent::keyboardAlt; guiKeyBoardMode.alt = (event.type == KeyPress) ? true : false; break; case 64: keyInput = ewol::keyEvent::keyboardAlt; guiKeyBoardMode.alt = (event.type == KeyPress) ? true : false; break;
case 108: keyInput = ewol::keyEvent::keyboardAltGr; guiKeyBoardMode.altGr = (event.type == KeyPress) ? true : false; break; case 108: keyInput = ewol::keyEvent::keyboardAltGr; guiKeyBoardMode.altGr = (event.type == KeyPress) ? true : false; break;
case 135: keyInput = ewol::keyEvent::keyboardContextMenu; break; case 135: keyInput = ewol::keyEvent::keyboardContextMenu; break;
case 77: keyInput = ewol::keyEvent::keyboardVerNum; guiKeyBoardMode.verNum = (event.type == KeyPress) ? true : false; break; case 77: keyInput = ewol::keyEvent::keyboardNumLock; guiKeyBoardMode.numLock = (event.type == KeyPress) ? true : false; break;
case 91: // Suppr on keypad case 91: // Suppr on keypad
find = false; find = false;
if(guiKeyBoardMode.numLock==true){
eSystem::SetKeyboard(guiKeyBoardMode, '.', (event.type==KeyPress));
} else {
eSystem::SetKeyboard(guiKeyBoardMode, 0x7F, (event.type==KeyPress)); eSystem::SetKeyboard(guiKeyBoardMode, 0x7F, (event.type==KeyPress));
}
break; break;
case 23: // special case for TAB case 23: // special case for TAB
find = false; find = false;
@ -1084,14 +1088,6 @@ int guiInterface::main(int argc, const char *argv[])
for (int32_t iii=0; iii<NB_MAX_INPUT; iii++) { for (int32_t iii=0; iii<NB_MAX_INPUT; iii++) {
inputIsPressed[iii] = false; inputIsPressed[iii] = false;
} }
guiKeyBoardMode.capLock = false;
guiKeyBoardMode.shift = false;
guiKeyBoardMode.ctrl = false;
guiKeyBoardMode.meta = false;
guiKeyBoardMode.alt = false;
guiKeyBoardMode.altGr = false;
guiKeyBoardMode.verNum = false;
guiKeyBoardMode.insert = false;
// start X11 thread ... // start X11 thread ...
X11_Init(); X11_Init();

View File

@ -376,8 +376,8 @@ void ewol::Widget::ShortCutAdd(const char * descriptiveString, const char * gene
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardStart; tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardStart;
} else if(NULL != strstr(descriptiveString, "END") ) { } else if(NULL != strstr(descriptiveString, "END") ) {
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardEnd; tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardEnd;
} else if(NULL != strstr(descriptiveString, "CENTER") ) { } else if(NULL != strstr(descriptiveString, "PRINT") ) {
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardCenter; tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardPrint;
} else if(NULL != strstr(descriptiveString, "ARRET_DEFIL") ) { } else if(NULL != strstr(descriptiveString, "ARRET_DEFIL") ) {
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardStopDefil; tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardStopDefil;
} else if(NULL != strstr(descriptiveString, "WAIT") ) { } else if(NULL != strstr(descriptiveString, "WAIT") ) {
@ -388,8 +388,8 @@ void ewol::Widget::ShortCutAdd(const char * descriptiveString, const char * gene
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardCapLock; tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardCapLock;
} else if(NULL != strstr(descriptiveString, "CONTEXT_MENU") ) { } else if(NULL != strstr(descriptiveString, "CONTEXT_MENU") ) {
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardContextMenu; tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardContextMenu;
} else if(NULL != strstr(descriptiveString, "VER_NUM") ) { } else if(NULL != strstr(descriptiveString, "NUM_LOCK") ) {
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardVerNum; tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardNumLock;
} else { } else {
tmpElement->unicodeValue = descriptiveString[strlen(descriptiveString) -1]; tmpElement->unicodeValue = descriptiveString[strlen(descriptiveString) -1];
} }

View File

@ -42,14 +42,6 @@ namespace ewol {
broadcastEvent = false; broadcastEvent = false;
generateEventId = NULL; generateEventId = NULL;
eventData = ""; eventData = "";
specialKey.capLock = false;
specialKey.shift = false;
specialKey.ctrl = false;
specialKey.meta = false;
specialKey.alt = false;
specialKey.altGr = false;
specialKey.verNum = false;
specialKey.insert = false;
unicodeValue = 0; unicodeValue = 0;
keyboardMoveValue = ewol::keyEvent::keyboardUnknow; keyboardMoveValue = ewol::keyEvent::keyboardUnknow;
}; };