Skip to content

Commit

Permalink
CLEAR ACTION: fixing bug that was pasting meaningless text when clear…
Browse files Browse the repository at this point in the history
…ing all entries
  • Loading branch information
Commit-La-Grenouille committed Mar 18, 2023
1 parent d3061de commit c4e2b12
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

A Stream Deck plugin for Mac to have some clipboard entries handy (independently from clipboard always changing status).

![Stream Deck screenshot](preview.png)
![Stream Deck screenshot](Sources/net.localhost.streamdeck.clipboard-buddy.sdPlugin/previews/2-states-relationship.png)

If you are on Windows, check [BarRaider](https://github.com/BarRaider)'s "Multi Clip" function available in his [Win Tools](https://github.com/BarRaider/streamdeck-wintools) plugin.

Expand Down
11 changes: 9 additions & 2 deletions Sources/MyStreamDeckPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,10 @@ - (void)setupIfNeeded

- (void)keyDownForAction:(NSString *)action withContext:(id)context withPayload:(NSDictionary *)payload forDevice:(NSString *)deviceID
{
// Useful only when dealing with STORE_ACT actions but does not hurt for others
_keyPressed = [[NSDate alloc] init];
// Useful only when dealing with STORE_ACT actions otherwise it would trigger a pasting on keyUpForAction
if([action isEqualToString:STORE_ACT]) {
_keyPressed = [[NSDate alloc] init];
}

if([action isEqualToString:NUKE_ACT]) {

Expand All @@ -400,6 +402,11 @@ - (void)keyDownForAction:(NSString *)action withContext:(id)context withPayload:

- (void)keyUpForAction:(NSString *)action withContext:(id)context withPayload:(NSDictionary *)payload forDevice:(NSString *)deviceID
{
if([action isEqualToString:NUKE_ACT]) {
// We should do nothing
return;
}

_keyReleased = [[NSDate alloc]init];
NSTimeInterval diff = [_keyReleased timeIntervalSinceDate:_keyPressed];

Expand Down
File renamed without changes

0 comments on commit c4e2b12

Please sign in to comment.