[DEBUG] corection of some error in the X11 abstraction and key event french name
This commit is contained in:
parent
ae29b34eab
commit
6de53cf3f2
2
build
2
build
@ -1 +1 @@
|
||||
Subproject commit a4e1c141f04e96da02edfa64644a85ab332eadad
|
||||
Subproject commit 0e65c531e58f33dbacc59ebeb4d41dd279cafc90
|
2
external/etk
vendored
2
external/etk
vendored
@ -1 +1 @@
|
||||
Subproject commit a44667d4566066767a7961dde989a661c932943e
|
||||
Subproject commit 1d4c27e7fd68cb9cbf11a89068c4b1d10744555c
|
@ -46,7 +46,7 @@ static const char* keyboardDescriptionString[ewol::keyEvent::keyboardCount+1] =
|
||||
"keyboardPageDown",
|
||||
"keyboardStart",
|
||||
"keyboardEnd",
|
||||
"keyboardCenter",
|
||||
"keyboardPrint",
|
||||
"keyboardStopDefil",
|
||||
"keyboardWait",
|
||||
"keyboardInsert",
|
||||
@ -72,7 +72,7 @@ static const char* keyboardDescriptionString[ewol::keyEvent::keyboardCount+1] =
|
||||
"keyboardAlt",
|
||||
"keyboardAltGr",
|
||||
"keyboardContextMenu",
|
||||
"keyboardVerNum",
|
||||
"keyboardNumLock",
|
||||
"keyboardCount"
|
||||
};
|
||||
|
||||
@ -111,3 +111,64 @@ ewol::SpecialKey& ewol::GetCurrentSpecialKeyStatus(void)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
@ -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
|
||||
*/
|
||||
typedef enum {
|
||||
typeUnknow = 0,
|
||||
typeMouse,
|
||||
typeFinger,
|
||||
typeStylet,
|
||||
typeCount
|
||||
typeUnknow = 0, //!< Unknow input Type
|
||||
typeMouse, //!< Mouse type
|
||||
typeFinger, //!< Finger type
|
||||
typeStylet, //!< Stylet type
|
||||
typeCount //!< number of types
|
||||
} type_te;
|
||||
/**
|
||||
* @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
|
||||
*/
|
||||
typedef enum {
|
||||
keyboardUnknow = 0,
|
||||
keyboardLeft,
|
||||
keyboardRight,
|
||||
keyboardUp,
|
||||
keyboardDown,
|
||||
keyboardPageUp,
|
||||
keyboardPageDown,
|
||||
keyboardStart,
|
||||
keyboardEnd,
|
||||
keyboardCenter,
|
||||
keyboardStopDefil,
|
||||
keyboardWait,
|
||||
keyboardInsert,
|
||||
keyboardF1,
|
||||
keyboardF2,
|
||||
keyboardF3,
|
||||
keyboardF4,
|
||||
keyboardF5,
|
||||
keyboardF6,
|
||||
keyboardF7,
|
||||
keyboardF8,
|
||||
keyboardF9,
|
||||
keyboardF10,
|
||||
keyboardF11,
|
||||
keyboardF12,
|
||||
keyboardCapLock,
|
||||
keyboardShiftLeft,
|
||||
keyboardShiftRight,
|
||||
keyboardCtrlLeft,
|
||||
keyboardCtrlRight,
|
||||
keyboardMetaLeft,
|
||||
keyboardMetaRight,
|
||||
keyboardAlt,
|
||||
keyboardAltGr,
|
||||
keyboardContextMenu,
|
||||
keyboardVerNum,
|
||||
keyboardCount
|
||||
keyboardUnknow = 0, //!< Unknown keyboard key
|
||||
keyboardLeft, //!< Left key <--
|
||||
keyboardRight, //!< Right key -->
|
||||
keyboardUp, //!< Up key ^
|
||||
keyboardDown, //!< Down key \/
|
||||
keyboardPageUp, //!< Page Up key
|
||||
keyboardPageDown, //!< page down key
|
||||
keyboardStart, //!< Start key
|
||||
keyboardEnd, //!< End key
|
||||
keyboardPrint, //!< Print screen key.
|
||||
keyboardStopDefil, //!< Stop display key.
|
||||
keyboardWait, //!< Wait key.
|
||||
keyboardInsert, //!< Insert key.
|
||||
keyboardF1, //!< F1 key.
|
||||
keyboardF2, //!< F2 key.
|
||||
keyboardF3, //!< F3 key.
|
||||
keyboardF4, //!< F4 key.
|
||||
keyboardF5, //!< F5 key.
|
||||
keyboardF6, //!< F6 key.
|
||||
keyboardF7, //!< F7 key.
|
||||
keyboardF8, //!< F8 key.
|
||||
keyboardF9, //!< F9 key.
|
||||
keyboardF10, //!< F10 key.
|
||||
keyboardF11, //!< F11 key.
|
||||
keyboardF12, //!< F12 key.
|
||||
keyboardCapLock, //!< Capital Letter Lock key.
|
||||
keyboardShiftLeft, //!< Shift left key.
|
||||
keyboardShiftRight, //!< Shift right key.
|
||||
keyboardCtrlLeft, //!< Control left key.
|
||||
keyboardCtrlRight, //!< Control right key.
|
||||
keyboardMetaLeft, //!< Meta left key (apple key or windows key).
|
||||
keyboardMetaRight, //!< Meta right key (apple key or windows key).
|
||||
keyboardAlt, //!< Alt key.
|
||||
keyboardAltGr, //!< Alt ground key.
|
||||
keyboardContextMenu, //!< Contextual menu key.
|
||||
keyboardNumLock, //!< Numerical Lock key.
|
||||
keyboardCount //!< number of posible key
|
||||
} keyboard_te;
|
||||
/**
|
||||
* @brief Debug operator To display the curent element in a Human redeable information
|
||||
@ -113,54 +113,60 @@ namespace ewol
|
||||
unsigned meta : 1;
|
||||
unsigned alt : 1;
|
||||
unsigned altGr : 1;
|
||||
unsigned verNum : 1;
|
||||
unsigned numLock : 1;
|
||||
unsigned insert : 1;
|
||||
};
|
||||
};
|
||||
SpecialKey(void) :
|
||||
value(0)
|
||||
{
|
||||
|
||||
}
|
||||
bool IsSetCapsLock(void)
|
||||
{
|
||||
return capLock;
|
||||
}
|
||||
|
||||
bool IsSetShift(void)
|
||||
{
|
||||
return shift;
|
||||
}
|
||||
|
||||
bool IsSetCtrl(void)
|
||||
{
|
||||
return ctrl;
|
||||
}
|
||||
|
||||
bool IsSetMeta(void)
|
||||
{
|
||||
return meta;
|
||||
}
|
||||
|
||||
bool IsSetAlt(void)
|
||||
{
|
||||
return alt;
|
||||
}
|
||||
|
||||
bool IsSetAltGr(void)
|
||||
{
|
||||
return altGr;
|
||||
}
|
||||
|
||||
bool IsSetVerNum(void)
|
||||
{
|
||||
return verNum;
|
||||
}
|
||||
bool IsSetInsert(void)
|
||||
{
|
||||
return insert;
|
||||
}
|
||||
public:
|
||||
/**
|
||||
* @brief Main constructor
|
||||
*/
|
||||
SpecialKey(void);
|
||||
/**
|
||||
* @brief Get the current CapLock Status
|
||||
* @return The status value
|
||||
*/
|
||||
bool IsSetCapsLock(void);
|
||||
/**
|
||||
* @brief Get the current Shift key status
|
||||
* @return The status value
|
||||
*/
|
||||
bool IsSetShift(void);
|
||||
/**
|
||||
* @brief Get the Current Control key status
|
||||
* @return The status value
|
||||
*/
|
||||
bool IsSetCtrl(void);
|
||||
/**
|
||||
* @brief Get the current Meta key status (also named windows or apple key)
|
||||
* @return The status value
|
||||
*/
|
||||
bool IsSetMeta(void);
|
||||
/**
|
||||
* @brief Get the current Alt key status
|
||||
* @return The status value
|
||||
*/
|
||||
bool IsSetAlt(void);
|
||||
/**
|
||||
* @brief Get the current Alt-Gr key status
|
||||
* @return The status value
|
||||
*/
|
||||
bool IsSetAltGr(void);
|
||||
/**
|
||||
* @brief Get the current Ver-num key status
|
||||
* @return The status value
|
||||
*/
|
||||
bool IsSetNumLock(void);
|
||||
/**
|
||||
* @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);
|
||||
};
|
||||
|
@ -129,13 +129,13 @@ void ewolProcessEvents(void)
|
||||
l_managementInput.State(data.inputType, data.inputId, data.stateIsDown, data.dimention);
|
||||
break;
|
||||
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();
|
||||
specialCurrentKey = data.keyboardSpecial;
|
||||
EWOL_DEBUG("newStatus Key" << specialCurrentKey);
|
||||
}
|
||||
// no break ... (normal case ...)
|
||||
case THREAD_KEYBORAD_MOVE:
|
||||
if (NULL != windowsCurrent) {
|
||||
if (false==windowsCurrent->OnEventShortCut(data.keyboardSpecial,
|
||||
data.keyboardChar,
|
||||
|
@ -790,9 +790,9 @@ void X11_Run(void)
|
||||
}
|
||||
if (event.xkey.state & (1<<4) ) {
|
||||
//EWOL_DEBUG(" Special Key : VER_num");
|
||||
guiKeyBoardMode.verNum = true;
|
||||
guiKeyBoardMode.numLock = true;
|
||||
} else {
|
||||
guiKeyBoardMode.verNum = false;
|
||||
guiKeyBoardMode.numLock = false;
|
||||
}
|
||||
if (event.xkey.state & (1<<5) ) {
|
||||
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 108: keyInput = ewol::keyEvent::keyboardAltGr; guiKeyBoardMode.altGr = (event.type == KeyPress) ? true : false; 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
|
||||
find = false;
|
||||
eSystem::SetKeyboard(guiKeyBoardMode, 0x7F, (event.type==KeyPress));
|
||||
if(guiKeyBoardMode.numLock==true){
|
||||
eSystem::SetKeyboard(guiKeyBoardMode, '.', (event.type==KeyPress));
|
||||
} else {
|
||||
eSystem::SetKeyboard(guiKeyBoardMode, 0x7F, (event.type==KeyPress));
|
||||
}
|
||||
break;
|
||||
case 23: // special case for TAB
|
||||
find = false;
|
||||
@ -1084,14 +1088,6 @@ int guiInterface::main(int argc, const char *argv[])
|
||||
for (int32_t iii=0; iii<NB_MAX_INPUT; iii++) {
|
||||
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 ...
|
||||
X11_Init();
|
||||
|
@ -28,22 +28,22 @@ namespace widget {
|
||||
class Button : public ewol::Widget
|
||||
{
|
||||
private:
|
||||
ewol::Shaper m_shaper; //!< Compositing theme.
|
||||
ewol::Text m_displayText; //!< compositing Text.
|
||||
ewol::Image m_displayImage; //!< Image to display in normal mode.
|
||||
draw::Color m_imageColor; //!< Image color to display it.
|
||||
ewol::Image m_displayImageToggle; //!< Image to display in toggle mode.
|
||||
draw::Color m_imageColorToggle; //!< Image color Toggle to display it.
|
||||
etk::UString m_label; //!< Labe to display in normal mode.
|
||||
etk::UString m_labelToggle; //!< Label to display when toggle mode is set ("" whenit is the same).
|
||||
bool m_toggleMode; //!< The button is able to toggle.
|
||||
bool m_value; //!< Current state of the button.
|
||||
bool m_mouseHover; //!< Flag to know where the mouse is (inside the displayed widget (if not fill)).
|
||||
bool m_buttonPressed; //!< Flag to know if the button is curently pressed.
|
||||
int32_t m_imageDisplaySize; //!< Display size of the Image.
|
||||
ewol::Shaper m_shaper; //!< Compositing theme.
|
||||
ewol::Text m_displayText; //!< compositing Text.
|
||||
ewol::Image m_displayImage; //!< Image to display in normal mode.
|
||||
draw::Color m_imageColor; //!< Image color to display it.
|
||||
ewol::Image m_displayImageToggle; //!< Image to display in toggle mode.
|
||||
draw::Color m_imageColorToggle; //!< Image color Toggle to display it.
|
||||
etk::UString m_label; //!< Labe to display in normal mode.
|
||||
etk::UString m_labelToggle; //!< Label to display when toggle mode is set ("" whenit is the same).
|
||||
bool m_toggleMode; //!< The button is able to toggle.
|
||||
bool m_value; //!< Current state of the button.
|
||||
bool m_mouseHover; //!< Flag to know where the mouse is (inside the displayed widget (if not fill)).
|
||||
bool m_buttonPressed; //!< Flag to know if the button is curently pressed.
|
||||
int32_t m_imageDisplaySize; //!< Display size of the Image.
|
||||
// hover area :
|
||||
vec2 m_selectableAreaPos; //!< Start position of the events
|
||||
vec2 m_selectableAreaSize; //!< Size of the event positions
|
||||
vec2 m_selectableAreaPos; //!< Start position of the events
|
||||
vec2 m_selectableAreaSize; //!< Size of the event positions
|
||||
public:
|
||||
/**
|
||||
* @brief Constructor
|
||||
|
@ -376,8 +376,8 @@ void ewol::Widget::ShortCutAdd(const char * descriptiveString, const char * gene
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardStart;
|
||||
} else if(NULL != strstr(descriptiveString, "END") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardEnd;
|
||||
} else if(NULL != strstr(descriptiveString, "CENTER") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardCenter;
|
||||
} else if(NULL != strstr(descriptiveString, "PRINT") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardPrint;
|
||||
} else if(NULL != strstr(descriptiveString, "ARRET_DEFIL") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardStopDefil;
|
||||
} 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;
|
||||
} else if(NULL != strstr(descriptiveString, "CONTEXT_MENU") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardContextMenu;
|
||||
} else if(NULL != strstr(descriptiveString, "VER_NUM") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardVerNum;
|
||||
} else if(NULL != strstr(descriptiveString, "NUM_LOCK") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardNumLock;
|
||||
} else {
|
||||
tmpElement->unicodeValue = descriptiveString[strlen(descriptiveString) -1];
|
||||
}
|
||||
|
@ -42,14 +42,6 @@ namespace ewol {
|
||||
broadcastEvent = false;
|
||||
generateEventId = NULL;
|
||||
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;
|
||||
keyboardMoveValue = ewol::keyEvent::keyboardUnknow;
|
||||
};
|
||||
@ -89,8 +81,8 @@ namespace ewol {
|
||||
vec2 m_minSize; //!< user define the minimum size of the widget
|
||||
// user configuaration
|
||||
vec2 m_userMinSize; //!< user define the minimum size of the widget
|
||||
bvec2 m_userExpend;
|
||||
bvec2 m_userFill;
|
||||
bvec2 m_userExpend;
|
||||
bvec2 m_userFill;
|
||||
public:
|
||||
/**
|
||||
* @brief Set the zoom property of the widget
|
||||
|
Loading…
x
Reference in New Issue
Block a user