bpo-39273: Expose BUTTON5_* constants in the curses module if available

This commit is contained in:
Zackery Spytz 2020-01-13 23:43:26 -07:00
parent a190e2ade1
commit c1e3b2f547
2 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1,2 @@
The ``BUTTON5_*`` constants are now exposed in the :mod:`curses` module if
available.

View File

@ -4691,6 +4691,14 @@ PyInit__curses(void)
SetDictInt("BUTTON4_DOUBLE_CLICKED", BUTTON4_DOUBLE_CLICKED);
SetDictInt("BUTTON4_TRIPLE_CLICKED", BUTTON4_TRIPLE_CLICKED);
#if NCURSES_MOUSE_VERSION > 1
SetDictInt("BUTTON5_PRESSED", BUTTON5_PRESSED);
SetDictInt("BUTTON5_RELEASED", BUTTON5_RELEASED);
SetDictInt("BUTTON5_CLICKED", BUTTON5_CLICKED);
SetDictInt("BUTTON5_DOUBLE_CLICKED", BUTTON5_DOUBLE_CLICKED);
SetDictInt("BUTTON5_TRIPLE_CLICKED", BUTTON5_TRIPLE_CLICKED);
#endif
SetDictInt("BUTTON_SHIFT", BUTTON_SHIFT);
SetDictInt("BUTTON_CTRL", BUTTON_CTRL);
SetDictInt("BUTTON_ALT", BUTTON_ALT);