diff options
-rw-r--r-- | uisimulator/x11/button-x11.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/uisimulator/x11/button-x11.c b/uisimulator/x11/button-x11.c index 1d27eff134..734272c6c4 100644 --- a/uisimulator/x11/button-x11.c +++ b/uisimulator/x11/button-x11.c | |||
@@ -135,6 +135,25 @@ static int get_raw_button (void) | |||
135 | } | 135 | } |
136 | 136 | ||
137 | /* | 137 | /* |
138 | * Timeout after TICKS unless a key is pressed. | ||
139 | */ | ||
140 | int button_get_w_tmo(int ticks) | ||
141 | { | ||
142 | int bits; | ||
143 | int i=0; | ||
144 | |||
145 | for(i=0; i< ticks; i++) { | ||
146 | bits = get_raw_button(); | ||
147 | if(!bits) | ||
148 | x11_sleep(1); | ||
149 | else | ||
150 | break; | ||
151 | }; | ||
152 | |||
153 | return bits; | ||
154 | } | ||
155 | |||
156 | /* | ||
138 | * Get the currently pressed button. | 157 | * Get the currently pressed button. |
139 | * Returns one of BUTTON_xxx codes, with possibly a modifier bit set. | 158 | * Returns one of BUTTON_xxx codes, with possibly a modifier bit set. |
140 | * No modifier bits are set when the button is first pressed. | 159 | * No modifier bits are set when the button is first pressed. |