ckb-next
v0.2.8 at branch master
ckb-next driver for corsair devices
|
#include <src/ckb/keywidget.h>
Public Types | |
typedef QHash< QString, QString > | BindMap |
Public Slots | |
void | displayColorMap (const ColorMap &newDisplayMap, const QSet< QString > &indicators=QSet< QString >()) |
Signals | |
void | selectionChanged (QStringList selected) |
void | sidelightToggled () |
Public Member Functions | |
KeyWidget (QWidget *parent=0, bool rgbMode=true) | |
bool | rgbMode () |
void | rgbMode (bool newRgbMode) |
bool | monochrome () |
void | monochrome (bool newMono) |
const KeyMap & | map () const |
void | map (const KeyMap &newMap) |
const QColorMap & | colorMap () const |
void | colorMap (const QColorMap &newColorMap) |
const BindMap & | bindMap () const |
void | bindMap (const BindMap &newBindMap) |
void | setSelection (const QStringList &keys) |
void | selectAll () |
void | clearSelection () |
void | setAnimation (const QStringList &keys) |
void | setAnimationToSelection () |
void | clearAnimation () |
Private Types | |
enum | { NONE, SET, ADD, SUBTRACT, TOGGLE } |
Private Member Functions | |
void | paintEvent (QPaintEvent *) |
void | mousePressEvent (QMouseEvent *event) |
void | mouseMoveEvent (QMouseEvent *event) |
void | mouseReleaseEvent (QMouseEvent *event) |
void | drawInfo (float &scale, float &offsetX, float &offsetY, int ratio=1) |
Private Attributes | |
KeyMap | keyMap |
QColorMap | _colorMap |
ColorMap | _displayColorMap |
BindMap | _bindMap |
QSet< QString > | _indicators |
QBitArray | selection |
QBitArray | newSelection |
QBitArray | animation |
int | mouseDownX |
int | mouseDownY |
int | mouseCurrentX |
int | mouseCurrentY |
enum KeyWidget:: { ... } | mouseDownMode |
bool | _rgbMode |
bool | _monochrome |
Definition at line 11 of file keywidget.h.
typedef QHash<QString, QString> KeyWidget::BindMap |
Definition at line 30 of file keywidget.h.
|
private |
Enumerator | |
---|---|
NONE | |
SET | |
ADD | |
SUBTRACT | |
TOGGLE |
Definition at line 66 of file keywidget.h.
|
explicit |
Definition at line 17 of file keywidget.cpp.
|
inline |
Definition at line 31 of file keywidget.h.
References _bindMap.
Referenced by KbBindWidget::updateBind().
void KeyWidget::bindMap | ( | const BindMap & | newBindMap | ) |
void KeyWidget::clearAnimation | ( | ) |
Definition at line 644 of file keywidget.cpp.
References animation.
Referenced by KbLightWidget::setLight().
void KeyWidget::clearSelection | ( | ) |
Definition at line 617 of file keywidget.cpp.
References mouseDownMode, newSelection, NONE, selection, and selectionChanged().
Referenced by KbLightWidget::changeAnim(), KbBindWidget::setBind(), and KbLightWidget::setLight().
|
inline |
Definition at line 27 of file keywidget.h.
References _colorMap.
Referenced by KbLightWidget::changeColor(), KbLightWidget::toggleSidelight(), and KbLightWidget::updateLight().
void KeyWidget::colorMap | ( | const QColorMap & | newColorMap | ) |
|
slot |
Definition at line 57 of file keywidget.cpp.
References _displayColorMap, and _indicators.
Referenced by KbLightWidget::on_showAnimBox_clicked().
|
private |
Definition at line 43 of file keywidget.cpp.
References KeyMap::height(), KEY_SIZE, keyMap, width, and KeyMap::width().
Referenced by mouseMoveEvent(), mousePressEvent(), and paintEvent().
|
inline |
Definition at line 24 of file keywidget.h.
References keyMap.
Referenced by KbBindWidget::newLayout(), and KbLightWidget::updateLight().
void KeyWidget::map | ( | const KeyMap & | newMap | ) |
Definition at line 24 of file keywidget.cpp.
References animation, KeyMap::count(), KeyMap::height(), KeyMap::isMouse(), KEY_SIZE, keyMap, newSelection, selection, width, and KeyMap::width().
|
inline |
Definition at line 20 of file keywidget.h.
References _monochrome.
Referenced by KbLightWidget::setMonochrome().
|
inline |
|
private |
Definition at line 487 of file keywidget.cpp.
References _indicators, _rgbMode, drawInfo(), Key::friendlyName(), Key::hasLed, Key::hasScan, Key::height, keyMap, KeyMap::model(), mouseCurrentX, mouseCurrentY, mouseDownMode, mouseDownX, mouseDownY, Key::name, newSelection, NONE, KeyMap::STRAFE, Key::width, Key::x, and Key::y.
|
private |
Definition at line 455 of file keywidget.cpp.
References _rgbMode, ADD, drawInfo(), Key::hasLed, Key::hasScan, Key::height, keyMap, mouseCurrentX, mouseCurrentY, mouseDownMode, mouseDownX, mouseDownY, Key::name, newSelection, SET, sidelightToggled(), SUBTRACT, TOGGLE, Key::width, Key::x, and Key::y.
|
private |
Definition at line 548 of file keywidget.cpp.
References ADD, keyMap, KeyMap::keys(), mouseDownMode, newSelection, NONE, selection, selectionChanged(), SET, SUBTRACT, and TOGGLE.
|
private |
Definition at line 70 of file keywidget.cpp.
References _bindMap, _colorMap, _displayColorMap, _indicators, _monochrome, _rgbMode, ADD, animation, ColorMap::colorForName(), KbBind::defaultAction(), drawInfo(), KeyMap::EU, KeyMap::EU_DVORAK, Key::friendlyName(), KeyMap::GLAIVE, glaiveOverlay, KbBind::globalRemap(), KeyMap::HARPOON, harpOverlay, Key::hasLed, Key::hasScan, Key::height, KeyMap::isMouse(), KeyMap::K65, KeyMap::K95P, keyMap, KeyMap::layout(), KeyMap::M65, m65Overlay, KeyMap::model(), monoRgb(), mouseCurrentX, mouseCurrentY, mouseDownMode, mouseDownX, mouseDownY, Key::name, newSelection, NONE, sabOverlay, KeyMap::SABRE, KeyMap::SCIMITAR, scimOverlay, selection, SET, KeyMap::STRAFE, SUBTRACT, TOGGLE, Key::width, width, Key::x, x, Key::y, and y.
|
inline |
Definition at line 17 of file keywidget.h.
References _rgbMode.
Referenced by KbBindWidget::KbBindWidget().
|
inline |
void KeyWidget::selectAll | ( | ) |
Definition at line 596 of file keywidget.cpp.
References _rgbMode, Key::hasLed, Key::hasScan, keyMap, mouseDownMode, Key::name, newSelection, NONE, KeyMap::positions(), selection, and selectionChanged().
Referenced by KbLightWidget::on_animButton_clicked(), and KbLightWidget::on_bgButton_clicked().
|
signal |
Definition at line 164 of file moc_keywidget.cpp.
Referenced by clearSelection(), mouseReleaseEvent(), selectAll(), and setSelection().
void KeyWidget::setAnimation | ( | const QStringList & | keys | ) |
Definition at line 625 of file keywidget.cpp.
References animation, keyMap, and KeyMap::keys().
Referenced by KbLightWidget::changeAnimKeys(), and KbLightWidget::setLight().
void KeyWidget::setAnimationToSelection | ( | ) |
Definition at line 639 of file keywidget.cpp.
References animation, and selection.
Referenced by KbLightWidget::changeAnim().
void KeyWidget::setSelection | ( | const QStringList & | keys | ) |
Definition at line 582 of file keywidget.cpp.
References keyMap, KeyMap::keys(), mouseDownMode, newSelection, NONE, selection, and selectionChanged().
Referenced by KbLightWidget::changeAnim().
|
signal |
Definition at line 171 of file moc_keywidget.cpp.
Referenced by mousePressEvent().
|
private |
Definition at line 58 of file keywidget.h.
Referenced by bindMap(), and paintEvent().
|
private |
Definition at line 56 of file keywidget.h.
Referenced by colorMap(), and paintEvent().
|
private |
Definition at line 57 of file keywidget.h.
Referenced by displayColorMap(), and paintEvent().
|
private |
Definition at line 59 of file keywidget.h.
Referenced by displayColorMap(), mouseMoveEvent(), and paintEvent().
|
private |
Definition at line 73 of file keywidget.h.
Referenced by monochrome(), and paintEvent().
|
private |
Definition at line 73 of file keywidget.h.
Referenced by mouseMoveEvent(), mousePressEvent(), paintEvent(), rgbMode(), and selectAll().
|
private |
Definition at line 63 of file keywidget.h.
Referenced by clearAnimation(), map(), paintEvent(), setAnimation(), and setAnimationToSelection().
|
private |
Definition at line 55 of file keywidget.h.
Referenced by drawInfo(), map(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), paintEvent(), selectAll(), setAnimation(), and setSelection().
|
private |
Definition at line 65 of file keywidget.h.
Referenced by mouseMoveEvent(), mousePressEvent(), and paintEvent().
|
private |
Definition at line 65 of file keywidget.h.
Referenced by mouseMoveEvent(), mousePressEvent(), and paintEvent().
enum { ... } KeyWidget::mouseDownMode |
Referenced by clearSelection(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), paintEvent(), selectAll(), and setSelection().
|
private |
Definition at line 64 of file keywidget.h.
Referenced by mouseMoveEvent(), mousePressEvent(), and paintEvent().
|
private |
Definition at line 64 of file keywidget.h.
Referenced by mouseMoveEvent(), mousePressEvent(), and paintEvent().
|
private |
Definition at line 62 of file keywidget.h.
Referenced by clearSelection(), map(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), paintEvent(), selectAll(), and setSelection().
|
private |
Definition at line 61 of file keywidget.h.
Referenced by clearSelection(), map(), mouseReleaseEvent(), paintEvent(), selectAll(), setAnimationToSelection(), and setSelection().