Disable the power button

Is is possible to disable the power button’s shutoff behaviour so that it can be reassigned via software? I have edited /etc/systemd/logind.conf as

HandlePowerKey=ignore
HandlePowerKeyLongPress=ignore
PowerKeyIgnoreInhibited=yes

but it seems to do nothing. Is power button behaviour controlled by the EC or something else?