Skip to content

Commit

Permalink
TINY-10490: add mouse right click (#138)
Browse files Browse the repository at this point in the history
* add mouse right click

* add changelog entry

* TINY-10490: fix changelog entry
  • Loading branch information
lorenzo-pomili authored Jan 9, 2024
1 parent 79d0f76 commit c673449
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Added
- Added `rightClick` to `MouseEffect.ts` #TINY-10490

## 14.1.0 - 2023-12-14

### Added
Expand Down
4 changes: 3 additions & 1 deletion modules/server/src/main/ts/bedrock/server/MouseEffects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as EffectUtils from './EffectUtils';
}
*/
export interface MouseData {
readonly type: 'move' | 'click' | 'down' | 'up';
readonly type: 'move' | 'click' | 'rightClick' | 'down' | 'up';
readonly selector: string;
}

Expand Down Expand Up @@ -36,6 +36,8 @@ const doAction = async (target: EffectUtils.ElementWithActions, type: MouseData[
// MicrosoftEdge does support this, but does not seem to support click in an ActionSequence
} else if (type === 'click') {
return target.click();
} else if (type === 'rightClick') {
return target.click({ button: 'right' });
} else {
return Promise.reject('Unknown mouse effect type: ' + type);
}
Expand Down

0 comments on commit c673449

Please sign in to comment.