summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/classes/Button.xml12
-rw-r--r--doc/classes/TreeItem.xml12
-rw-r--r--platform/linuxbsd/joypad_linux.cpp11
3 files changed, 20 insertions, 15 deletions
diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml
index 675441d842..de05cfcd13 100644
--- a/doc/classes/Button.xml
+++ b/doc/classes/Button.xml
@@ -5,6 +5,18 @@
</brief_description>
<description>
Button is the standard themed button. It can contain text and an icon, and will display them according to the current [Theme].
+ [b]Example of creating a button and assigning an action when pressed by code:[/b]
+ [codeblock]
+ func _ready():
+ var button = Button.new()
+ button.text = "Click me"
+ button.connect("pressed", self, "_button_pressed")
+ add_child(button)
+
+ func _button_pressed():
+ print("Hello world!")
+ [/codeblock]
+ Buttons (like all Control nodes) can also be created in the editor, but some situations may require creating them from code.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml
index 126d6b4180..22e643a51d 100644
--- a/doc/classes/TreeItem.xml
+++ b/doc/classes/TreeItem.xml
@@ -118,7 +118,7 @@
<return type="TreeItem">
</return>
<description>
- Returns the TreeItem's child items.
+ Returns the TreeItem's first child item or a null object if there is none.
</description>
</method>
<method name="get_custom_bg_color" qualifiers="const">
@@ -196,7 +196,7 @@
<return type="TreeItem">
</return>
<description>
- Returns the next TreeItem in the tree.
+ Returns the next TreeItem in the tree or a null object if there is none.
</description>
</method>
<method name="get_next_visible">
@@ -205,7 +205,7 @@
<argument index="0" name="wrap" type="bool" default="false">
</argument>
<description>
- Returns the next visible TreeItem in the tree.
+ Returns the next visible TreeItem in the tree or a null object if there is none.
If [code]wrap[/code] is enabled, the method will wrap around to the first visible element in the tree when called on the last visible element, otherwise it returns [code]null[/code].
</description>
</method>
@@ -213,14 +213,14 @@
<return type="TreeItem">
</return>
<description>
- Returns the parent TreeItem.
+ Returns the parent TreeItem or a null object if there is none.
</description>
</method>
<method name="get_prev">
<return type="TreeItem">
</return>
<description>
- Returns the previous TreeItem in the tree.
+ Returns the previous TreeItem in the tree or a null object if there is none.
</description>
</method>
<method name="get_prev_visible">
@@ -229,7 +229,7 @@
<argument index="0" name="wrap" type="bool" default="false">
</argument>
<description>
- Returns the previous visible TreeItem in the tree.
+ Returns the previous visible TreeItem in the tree or a null object if there is none.
If [code]wrap[/code] is enabled, the method will wrap around to the last visible element in the tree when called on the first visible element, otherwise it returns [code]null[/code].
</description>
</method>
diff --git a/platform/linuxbsd/joypad_linux.cpp b/platform/linuxbsd/joypad_linux.cpp
index 5edaf35c50..fda1358dfd 100644
--- a/platform/linuxbsd/joypad_linux.cpp
+++ b/platform/linuxbsd/joypad_linux.cpp
@@ -311,16 +311,9 @@ void JoypadLinux::open_joypad(const char *p_path) {
return;
}
- //check if the device supports basic gamepad events, prevents certain keyboards from
- //being detected as joypads
+ // Check if the device supports basic gamepad events
if (!(test_bit(EV_KEY, evbit) && test_bit(EV_ABS, evbit) &&
- (test_bit(ABS_X, absbit) || test_bit(ABS_Y, absbit) || test_bit(ABS_HAT0X, absbit) ||
- test_bit(ABS_GAS, absbit) || test_bit(ABS_RUDDER, absbit)) &&
- (test_bit(BTN_A, keybit) || test_bit(BTN_THUMBL, keybit) ||
- test_bit(BTN_TRIGGER, keybit) || test_bit(BTN_1, keybit))) &&
- !(test_bit(EV_ABS, evbit) &&
- test_bit(ABS_X, absbit) && test_bit(ABS_Y, absbit) &&
- test_bit(ABS_RX, absbit) && test_bit(ABS_RY, absbit))) {
+ test_bit(ABS_X, absbit) && test_bit(ABS_Y, absbit))) {
close(fd);
return;
}