Skip to content

Commit

Permalink
rename hyper as hypershift to bypass naming conflict in Win
Browse files Browse the repository at this point in the history
  • Loading branch information
groverlynn committed Oct 9, 2023
1 parent 816e14b commit 34cd4cf
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/rime/gear/ascii_composer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ AsciiComposer::~AsciiComposer() {

ProcessResult AsciiComposer::ProcessKeyEvent(const KeyEvent& key_event) {
if ((key_event.shift() && key_event.ctrl()) || key_event.alt() ||
key_event.hyper() || key_event.super()) {
key_event.hypershift() || key_event.super()) {
shift_key_pressed_ = ctrl_key_pressed_ = false;
return kNoop;
}
Expand Down
2 changes: 1 addition & 1 deletion src/rime/gear/editor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ ProcessResult Editor::ProcessKeyEvent(const KeyEvent& key_event) {
}
}
if (char_handler_ && !key_event.ctrl() && !key_event.alt() &&
!key_event.super() && !key_event.hyper() && ch > 0x20 && ch < 0x7f) {
!key_event.super() && !key_event.hypershift() && ch > 0x20 && ch < 0x7f) {
DLOG(INFO) << "input char: '" << (char)ch << "', " << ch << ", '"
<< key_event.repr() << "'";
return RIME_THIS_CALL(char_handler_)(ctx, ch);
Expand Down
4 changes: 2 additions & 2 deletions src/rime/gear/punctuator.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// encoding: utf-8
// encoding: utf-8
//
// Copyright RIME Developers
// Distributed under the BSD License
Expand Down Expand Up @@ -60,7 +60,7 @@ static bool punctuation_is_translated(Context* ctx) {

ProcessResult Punctuator::ProcessKeyEvent(const KeyEvent& key_event) {
if (key_event.release() || key_event.ctrl() || key_event.alt() ||
key_event.hyper() || key_event.super())
key_event.hypershift() || key_event.super())
return kNoop;
int ch = key_event.keycode();
if (ch < 0x20 || ch >= 0x7f)
Expand Down
2 changes: 1 addition & 1 deletion src/rime/gear/recognizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Recognizer::Recognizer(const Ticket& ticket) : Processor(ticket) {

ProcessResult Recognizer::ProcessKeyEvent(const KeyEvent& key_event) {
if (patterns_.empty() || key_event.ctrl() || key_event.alt() ||
key_event.hyper() || key_event.super() || key_event.release()) {
key_event.hypershift() || key_event.super() || key_event.release()) {
return kNoop;
}
int ch = key_event.keycode();
Expand Down
2 changes: 1 addition & 1 deletion src/rime/gear/selector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ inline static bool is_linear_layout(Context* ctx) {
}

ProcessResult Selector::ProcessKeyEvent(const KeyEvent& key_event) {
if (key_event.release() || key_event.alt() || key_event.hyper() ||
if (key_event.release() || key_event.alt() || key_event.hypershift() ||
key_event.super())
return kNoop;
Context* ctx = engine_->context();
Expand Down
2 changes: 1 addition & 1 deletion src/rime/gear/shape.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ProcessResult ShapeProcessor::ProcessKeyEvent(const KeyEvent& key_event) {
if (!engine_->context()->get_option("full_shape")) {
return kNoop;
}
if (key_event.ctrl() || key_event.alt() || key_event.hyper() ||
if (key_event.ctrl() || key_event.alt() || key_event.hypershift() ||
key_event.super() || key_event.release()) {
return kNoop;
}
Expand Down
2 changes: 1 addition & 1 deletion src/rime/gear/speller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Speller::Speller(const Ticket& ticket)

ProcessResult Speller::ProcessKeyEvent(const KeyEvent& key_event) {
if (key_event.release() || key_event.ctrl() || key_event.alt() ||
key_event.hyper() || key_event.super())
key_event.hypershift() || key_event.super())
return kNoop;
int ch = key_event.keycode();
if (ch < 0x20 || ch >= 0x7f) // not a valid key for spelling
Expand Down
4 changes: 2 additions & 2 deletions src/rime/key_event.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// encoding: utf-8
// encoding: utf-8
//
// Copyright RIME Developers
// Distributed under the BSD License
Expand Down Expand Up @@ -31,7 +31,7 @@ class KeyEvent {
bool alt() const { return (modifier_ & kAltMask) != 0; }
bool caps() const { return (modifier_ & kLockMask) != 0; }
bool super() const { return (modifier_ & kSuperMask) != 0; }
bool hyper() const { return (modifier_ & kHyperMask) != 0; }
bool hypershift() const { return (modifier_ & kHyperMask) != 0; }
bool release() const { return (modifier_ & kReleaseMask) != 0; }
// 按鍵表示為形如「狀態+鍵名」的文字
// 若無鍵名,則以四位或六位十六进制数形式的文字來標識
Expand Down

0 comments on commit 34cd4cf

Please sign in to comment.