How do I detect when the user types a specific character/string?

I reflexively use * to start bulleted lists, but because I have “Auto pair Markdown syntax” enabled, this means that as I start typing my editor fills up with state such as

* <cursor>*

and then

* Hello, world!<cursor>*

I’d like to write a plugin that detects when I begin a line with * and suppresses the trailing * that would otherwise be inserted, but I can’t figure out how to tell Obsidian to listen for those characters being entered. How can I do that?

I think there is obsidian\setting\editor that prevent the pair

I like the pairing behavior generally, I just want to suppress it at the start of a line in some cases. And I think figuring out how to do this would help with writing plugins in general.