summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZiTe <honmonoh@gmail.com>2022-03-08 12:16:35 +0800
committerGitHub <noreply@github.com>2022-03-07 20:16:35 -0800
commit0880850b158ca5da4eae28c43849909c01350f0f (patch)
tree2d23b7a1da6d34854d5cb99eb4cf49c062925835
parent8f70adc0b6e8c1e7f08f9fd2496385c4053282ee (diff)
[Bug] Rename has_mouse_report_changed parameters (#16417)0.16.4
Fixes compilation issues when bluetooth is enabled, due to issues with cpp used by bluetooth code. Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: Drashna Jaelre <drashna@live.com>
-rw-r--r--docs/feature_pointing_device.md6
-rw-r--r--docs/ja/feature_pointing_device.md4
-rw-r--r--quantum/pointing_device.c14
-rw-r--r--quantum/pointing_device.h4
4 files changed, 14 insertions, 14 deletions
diff --git a/docs/feature_pointing_device.md b/docs/feature_pointing_device.md
index 4b39599f8a..23a16b843d 100644
--- a/docs/feature_pointing_device.md
+++ b/docs/feature_pointing_device.md
@@ -245,7 +245,7 @@ The following configuration options are only available when using `SPLIT_POINTIN
| `pointing_device_get_report(void)` | Returns the current mouse report (as a `mouse_report_t` data structure). |
| `pointing_device_set_report(mouse_report)` | Sets the mouse report to the assigned `mouse_report_t` data structured passed to the function. |
| `pointing_device_send(void)` | Sends the current mouse report to the host system. Function can be replaced. |
-| `has_mouse_report_changed(old, new)` | Compares the old and new `mouse_report_t` data and returns true only if it has changed. |
+| `has_mouse_report_changed(new_report, old_report)` | Compares the old and new `mouse_report_t` data and returns true only if it has changed. |
| `pointing_device_adjust_by_defines(mouse_report)` | Applies rotations and invert configurations to a raw mouse report. |
@@ -276,14 +276,14 @@ The report_mouse_t (here "mouseReport") has the following properties:
To manually manipulate the mouse reports outside of the `pointing_device_task_*` functions, you can use:
* `pointing_device_get_report()` - Returns the current report_mouse_t that represents the information sent to the host computer
-* `pointing_device_set_report(report_mouse_t newMouseReport)` - Overrides and saves the report_mouse_t to be sent to the host computer
+* `pointing_device_set_report(report_mouse_t mouse_report)` - Overrides and saves the report_mouse_t to be sent to the host computer
* `pointing_device_send()` - Sends the mouse report to the host and zeroes out the report.
When the mouse report is sent, the x, y, v, and h values are set to 0 (this is done in `pointing_device_send()`, which can be overridden to avoid this behavior). This way, button states persist, but movement will only occur once. For further customization, both `pointing_device_init` and `pointing_device_task` can be overridden.
Additionally, by default, `pointing_device_send()` will only send a report when the report has actually changed. This prevents it from continuously sending mouse reports, which will keep the host system awake. This behavior can be changed by creating your own `pointing_device_send()` function.
-Also, you use the `has_mouse_report_changed(new, old)` function to check to see if the report has changed.
+Also, you use the `has_mouse_report_changed(new_report, old_report)` function to check to see if the report has changed.
## Examples
diff --git a/docs/ja/feature_pointing_device.md b/docs/ja/feature_pointing_device.md
index 69bd86c552..0f472f0ffe 100644
--- a/docs/ja/feature_pointing_device.md
+++ b/docs/ja/feature_pointing_device.md
@@ -16,7 +16,7 @@ POINTING_DEVICE_ENABLE = yes
マウスレポートを操作するために、以下の関数を使うことができます:
* `pointing_device_get_report()` - ホストコンピュータに送信された情報を表す現在の report_mouse_t を返します。
-* `pointing_device_set_report(report_mouse_t newMouseReport)` - ホストコンピュータに送信される report_mouse_t を上書き保存します。
+* `pointing_device_set_report(report_mouse_t mouse_report)` - ホストコンピュータに送信される report_mouse_t を上書き保存します。
report_mouse_t (ここでは "mouseReport") が以下のプロパティを持つことを覚えておいてください:
@@ -34,7 +34,7 @@ report_mouse_t (ここでは "mouseReport") が以下のプロパティを持つ
さらに、デフォルトでは、`pointing_device_send()` はレポートが実際に変更された場合のみレポートを送信します。これにより、マウスレポートが継続的に送信されてホストシステムが起動されたままになることを防ぎます。この動作は、独自の `pointing_device_send()` 関数を作成することで変更できます。
-また、`has_mouse_report_changed(new, old)` 関数を使って、レポートが変更されたかどうかを確認できます。(訳注:独自の `pointing_device_send()` 関数を作成する場合でも、その中で `has_mouse_report_changed(new, old)` 関数でチェックして、デフォルトの `pointing_device_send()` と類似の無駄なレポートの抑制をして、ホストシステムがスリープ状態に入れる余地を残すようにしておくのが良いでしょう。)
+また、`has_mouse_report_changed(new_report, old_report)` 関数を使って、レポートが変更されたかどうかを確認できます。(訳注:独自の `pointing_device_send()` 関数を作成する場合でも、その中で `has_mouse_report_changed(new_report, old_report)` 関数でチェックして、デフォルトの `pointing_device_send()` と類似の無駄なレポートの抑制をして、ホストシステムがスリープ状態に入れる余地を残すようにしておくのが良いでしょう。)
以下の例では、カスタムキーを使ってマウスをクリックし垂直および水平方向に127単位スクロールし、リリースされた時にそれを全て元に戻します - なぜならこれは完全に便利な機能だからです。いいですか、以下はひとつの例です:
diff --git a/quantum/pointing_device.c b/quantum/pointing_device.c
index 9627cab4b8..47a0af45d2 100644
--- a/quantum/pointing_device.c
+++ b/quantum/pointing_device.c
@@ -73,12 +73,12 @@ extern const pointing_device_driver_t pointing_device_driver;
/**
* @brief Compares 2 mouse reports for difference and returns result
*
- * @param[in] new report_mouse_t
- * @param[in] old report_mouse_t
+ * @param[in] new_report report_mouse_t
+ * @param[in] old_report report_mouse_t
* @return bool result
*/
-__attribute__((weak)) bool has_mouse_report_changed(report_mouse_t new, report_mouse_t old) {
- return memcmp(&new, &old, sizeof(new));
+__attribute__((weak)) bool has_mouse_report_changed(report_mouse_t new_report, report_mouse_t old_report) {
+ return memcmp(&new_report, &old_report, sizeof(new_report));
}
/**
@@ -292,10 +292,10 @@ report_mouse_t pointing_device_get_report(void) {
/**
* @brief Sets mouse report used be pointing device task
*
- * @param[in] new_mouse_report
+ * @param[in] mouse_report
*/
-void pointing_device_set_report(report_mouse_t new_mouse_report) {
- local_mouse_report = new_mouse_report;
+void pointing_device_set_report(report_mouse_t mouse_report) {
+ local_mouse_report = mouse_report;
}
/**
diff --git a/quantum/pointing_device.h b/quantum/pointing_device.h
index 5f3845227a..a6bdbf120c 100644
--- a/quantum/pointing_device.h
+++ b/quantum/pointing_device.h
@@ -79,8 +79,8 @@ void pointing_device_init(void);
void pointing_device_task(void);
void pointing_device_send(void);
report_mouse_t pointing_device_get_report(void);
-void pointing_device_set_report(report_mouse_t newMouseReport);
-bool has_mouse_report_changed(report_mouse_t new, report_mouse_t old);
+void pointing_device_set_report(report_mouse_t mouse_report);
+bool has_mouse_report_changed(report_mouse_t new_report, report_mouse_t old_report);
uint16_t pointing_device_get_cpi(void);
void pointing_device_set_cpi(uint16_t cpi);