Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
groverlynn committed Jul 15, 2023
1 parent 978cdae commit b48ce08
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/rime/gear/ascii_composer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ 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()) {
if ((key_event.shift() && key_event.ctrl()) || key_event.alt() ||
key_event.hyper() || key_event.super()) {
shift_key_pressed_ = ctrl_key_pressed_ = false;
return kNoop;
}
Expand Down
7 changes: 3 additions & 4 deletions src/rime/gear/editor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@ 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) {
DLOG(INFO) << "input char: '" << (char)ch << "', " << ch
<< ", '" << key_event.repr() << "'";
!key_event.super() && !key_event.hyper() && ch > 0x20 && ch < 0x7f) {
DLOG(INFO) << "input char: '" << (char)ch << "', " << ch << ", '"
<< key_event.repr() << "'";
return RIME_THIS_CALL(char_handler_)(ctx, ch);
}
// not handled
Expand Down
12 changes: 9 additions & 3 deletions src/rime/gear/punctuator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ ProcessResult Punctuator::ProcessKeyEvent(const KeyEvent& key_event) {
if (!use_space_ && ch == XK_space && ctx->IsComposing()) {
return kNoop;
}
if (ch == '.' || ch == ':' || ch == ',' || ch == '\'') { // 3.14 12:30 4'999,95
if (ch == '.' || ch == ':' || ch == ',' ||
ch == '\'') { // 3.14 12:30 4'999,95
const CommitHistory& history(ctx->commit_history());
if (!history.empty()) {
const CommitRecord& cr(history.back());
Expand Down Expand Up @@ -210,8 +211,13 @@ an<Candidate> CreatePunctCandidate(const string& punct,
bool is_half_shape_kana = (ch >= 0xFF61 && ch <= 0xFF9F);
bool is_hangul = (ch >= 0x3131 && ch <= 0x3164);
bool is_half_shape_hangul = (ch >= 0xFFA0 && ch <= 0xFFDC);
bool is_full_shape_narrow_symbol = ((ch >= 0x3008 && ch <= 0x300B) || (ch >= 0x3018 && ch <= 0x301B) || ch == 0xFF5F || ch == 0xFF60 || (ch >= 0xFFE0 && ch <= 0xFFE6));
bool is_narrow_symbol = (ch == 0x00A2 || ch == 0x00A3 || ch == 0x00A5 || ch == 0x00A6 || ch == 0x00AC || ch == 0x00AF || ch == 0x20A9 || (ch >= 0x27E6 && ch <= 0x27ED) || ch == 0x2985 || ch == 0x2986);
bool is_full_shape_narrow_symbol =
((ch >= 0x3008 && ch <= 0x300B) || (ch >= 0x3018 && ch <= 0x301B) ||
ch == 0xFF5F || ch == 0xFF60 || (ch >= 0xFFE0 && ch <= 0xFFE6));
bool is_narrow_symbol =
(ch == 0x00A2 || ch == 0x00A3 || ch == 0x00A5 || ch == 0x00A6 ||
ch == 0x00AC || ch == 0x00AF || ch == 0x20A9 ||
(ch >= 0x27E6 && ch <= 0x27ED) || ch == 0x2985 || ch == 0x2986);
bool is_half_shape_wide_symbol = (ch >= 0xFFE8 && ch <= 0xFFEE);
bool is_wide_symbol = ((ch >= 0x2190 && ch <= 0x2193) || ch == 0x2502 ||
ch == 0x25A0 || ch == 0x25CB);
Expand Down
4 changes: 2 additions & 2 deletions src/rime/gear/selector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ 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() || key_event.super())
if (key_event.release() || key_event.alt() || key_event.hyper() ||
key_event.super())
return kNoop;
Context* ctx = engine_->context();
if (ctx->composition().empty())
Expand Down
6 changes: 3 additions & 3 deletions src/rime/key_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
namespace rime {

class KeyEvent {
public:
public:
KeyEvent() = default;
KeyEvent(int keycode, int modifier)
: keycode_(keycode), modifier_(modifier) {}
Expand Down Expand Up @@ -51,14 +51,14 @@ class KeyEvent {
return modifier_ < other.modifier_;
}

private:
private:
int keycode_ = 0;
int modifier_ = 0;
};

// 按鍵序列
class KeySequence : public vector<KeyEvent> {
public:
public:
KeySequence() = default;
RIME_API KeySequence(const string& repr);

Expand Down

0 comments on commit b48ce08

Please sign in to comment.