Dismissing alarm with buttons on Galaxy S9+ On older android phones I could dismiss clock alarm by pressing any button. On the new galaxy s9+ I have to use the screen, which is highly inconvenient if the alarm goes off when I'm driving. Therefore I'd like to configure the clock app to dismiss the alarm on button press.

Online search led to advice that was irrelevant to the current clock app, for example to use the triple dot menu of the clock app. The current clock app has nothing useful on the triple dot menu, just the About and one other item. I couldn't find the settings for that elsewhere either.

Could you suggest a solution?
You can use AutoInput with Tasker to do this.

Note: tested on stock Android with stock Clock app only. 


Install AutoInput.
Enable Intercept Keys in it. Disable Doze if it asks for.
Install and setup Tasker.
Create a profile under Event &rarr; Plugin &rarr; AutoInput &rarr; Key &rarr; setup the configuration for a single key only, say a Volume rocker.
Create a task for that profile named "Dismiss Alarm on keypress" and set the action to System &rarr; Cancel Alarm &rarr; Disable Current.
Since Autoinput intercepts the key, you would find the key failing to perform its default functions. As a remedy, you would want to add an another action within that same task, depending upon the key you chose in Profile. I suggest you limit the keys to Volume rockers because Power key functionality may be hard to imitate through Tasker. 


The benefit of using AutoInput is that it works both for Screen Off and Screen On states.



If you want to avoid this hassle, but can compromise with having functionality only when Screen is One and limited to few keys, than consider MacroDroid.


Install it
Setup Trigger to any Volume Button Pressed &rarr; Monitor Volume Changes &rarr; choose your key &rarr; Update Volume.
Setup Action to Alarm Clock &rarr; Dismiss Active Alarm.


This should work within limited aforementioned constraints.