summaryrefslogtreecommitdiff
path: root/windows/keybuddy2/src/keyButton.h
diff options
context:
space:
mode:
Diffstat (limited to 'windows/keybuddy2/src/keyButton.h')
-rw-r--r--windows/keybuddy2/src/keyButton.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/windows/keybuddy2/src/keyButton.h b/windows/keybuddy2/src/keyButton.h
new file mode 100644
index 0000000..38e9484
--- /dev/null
+++ b/windows/keybuddy2/src/keyButton.h
@@ -0,0 +1,25 @@
+#ifndef _KeyBuddy2_keyButton_h_
+#define _KeyBuddy2_keyButton_h_
+
+// custom button class, that is extended by simulated pushes and releases
+class keyButton:public Button{
+public:
+ int finger; // for which finger is this button? (determines the drawing color)
+ void simDown(){
+ if(IsReadOnly() || !IsEnabled() || IsPush()) return;
+ KeyPush();
+ Sync();
+ }
+ void simUp(){
+ if(!IsPush()) return;
+ FinishPush();
+ Sync();
+ }
+ bool isPushed(){
+ return IsPush();
+ }
+ void LeftDown(Point, dword){}; // overwrite mouse action so buttons do not react to clicking
+ void LeftUp(Point, dword){};
+};
+
+#endif