Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
078592a5
Commit
078592a5
authored
Mar 04, 2021
by
Robin Eschbach
Browse files
[ADD
#41
] hotkeys
parent
555f9c20
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
6 deletions
+46
-6
src/modules/pointConnector/WFiberHandler.cpp
src/modules/pointConnector/WFiberHandler.cpp
+5
-0
src/modules/pointConnector/WFiberHandler.h
src/modules/pointConnector/WFiberHandler.h
+5
-0
src/modules/pointConnector/WKeyboardHandler.cpp
src/modules/pointConnector/WKeyboardHandler.cpp
+25
-6
src/modules/pointConnector/WMPointConnector.cpp
src/modules/pointConnector/WMPointConnector.cpp
+5
-0
src/modules/pointConnector/WMPointConnector.h
src/modules/pointConnector/WMPointConnector.h
+6
-0
No files found.
src/modules/pointConnector/WFiberHandler.cpp
View file @
078592a5
...
...
@@ -233,3 +233,8 @@ size_t WFiberHandler::getSelectedFiber()
{
return
m_selectedFiber
;
}
WActionHandler
::
SPtr
WFiberHandler
::
getActionHandler
()
{
return
m_actionHandler
;
}
src/modules/pointConnector/WFiberHandler.h
View file @
078592a5
...
...
@@ -127,6 +127,11 @@ public:
size_t
getSelectedFiber
();
/**
* \return WActionHandler::SPtr The WActionHandler of this class.
*/
WActionHandler
::
SPtr
getActionHandler
();
private:
/**
* Update handler for the properties
...
...
src/modules/pointConnector/WKeyboardHandler.cpp
View file @
078592a5
...
...
@@ -22,8 +22,15 @@
//
//---------------------------------------------------------------------------
#include "WFiberHandler.h"
#include "WKeyboardHandler.h"
static
const
unsigned
int
CTRL_DOWN
=
65507
;
static
const
unsigned
int
CTRL_UP
=
16777249
;
static
const
unsigned
int
KEY_Z
=
90
;
static
const
unsigned
int
KEY_Y
=
89
;
WKeyboardHandler
::
WKeyboardHandler
(
WMPointConnector
*
connector
)
:
m_connector
(
connector
)
{
...
...
@@ -33,16 +40,28 @@ bool WKeyboardHandler::handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActio
{
if
(
ea
.
getEventType
()
==
osgGA
::
GUIEventAdapter
::
KEYDOWN
)
{
std
::
cout
<<
"DOWN KEY:
\t\t\t
"
<<
ea
.
getKey
()
<<
std
::
endl
;
std
::
cout
<<
"
\t
Unmodified Key:
\t\t
"
<<
ea
.
getUnmodifiedKey
()
<<
std
::
endl
;
std
::
cout
<<
"
\t
ModKeyMask:
\t\t
"
<<
ea
.
getModKeyMask
()
<<
std
::
endl
;
if
(
ea
.
getKey
()
==
CTRL_DOWN
)
{
m_isCtrl
=
true
;
}
else
if
(
ea
.
getKey
()
==
KEY_Z
&&
m_isCtrl
)
{
m_connector
->
getFiberHandler
()
->
getActionHandler
()
->
undo
();
return
true
;
}
else
if
(
ea
.
getKey
()
==
KEY_Y
&&
m_isCtrl
)
{
m_connector
->
getFiberHandler
()
->
getActionHandler
()
->
redo
();
return
true
;
}
}
if
(
ea
.
getEventType
()
==
osgGA
::
GUIEventAdapter
::
KEYUP
)
{
std
::
cout
<<
"UP KEY:
\t\t\t\t
"
<<
ea
.
getKey
()
<<
std
::
endl
;
std
::
cout
<<
"
\t
Unmodified Key:
\t\t
"
<<
ea
.
getUnmodifiedKey
()
<<
std
::
endl
;
std
::
cout
<<
"
\t
ModKeyMask:
\t\t
"
<<
ea
.
getModKeyMask
()
<<
std
::
endl
;
if
(
ea
.
getKey
()
==
CTRL_UP
)
{
m_isCtrl
=
false
;
}
}
return
false
;
...
...
src/modules/pointConnector/WMPointConnector.cpp
View file @
078592a5
...
...
@@ -299,3 +299,8 @@ WConnectorData::SPtr WMPointConnector::getConnectorData()
{
return
m_connectorData
;
}
WFiberHandler
::
SPtr
WMPointConnector
::
getFiberHandler
()
{
return
m_fiberHandler
;
}
src/modules/pointConnector/WMPointConnector.h
View file @
078592a5
...
...
@@ -122,6 +122,12 @@ public:
*/
boost
::
shared_ptr
<
WConnectorData
>
getConnectorData
();
/**
*
* \return boost::shared_ptr< WFiberHandler > The WFiberHandler of this module.
*/
boost
::
shared_ptr
<
WFiberHandler
>
getFiberHandler
();
protected:
/**
* Entry point after loading the module. Runs in separate thread.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment