D 2019-07-20T14:52:32.379 J comment The\sattached\spatch\sattempts\sto\sadd\ssupport\sfor\smouse\sbuttons\s4\sand\s5\sto\sTk\sfor\sWindows.\s(These\sbuttons\sare\scalled\sXButton1\sand\sXButton2\sin\sthe\sWindows\sAPI\sdocumentation.)\sCurrently,\sTk\sprograms\son\sWindows\sdo\snot\sdetect\sthese\sbuttons\sat\sall,\seven\swith\s<ButtonPress>.\sI\sbelieve\sthat\sthese\sbuttons,\sif\snot\srepurposed\sby\sthe\suser,\sshould\sbe\savailable\sto\sTk\sprograms,\sas\sthey\scurrently\sare\son\sAqua\s(as\sbuttons\s4\sand\s5)\sand\sX11\s(as\sbuttons\s8\sand\s9).\sOne\scommon\sbinding\sfor\sthese\sbuttons\sis\sfor\sback/forward\snavigation\sin\sbrowsers.\r\n\r\nI\sam\snot\ssure\sto\swhat\sextent\sthis\sfunctionality\shas\sbeen\srequested\sin\sthe\spast,\sor\swhether\sany\sefforts\swere\smade\sto\simplement\ssupport\sfor\sthem\s(either\sin\sTk\sor\sextensions).\sI\sfound\sone\sdiscussion\sfrom\s2011\son\scomp.lang.tcl:\s[https://groups.google.com/forum/#!msg/comp.lang.tcl/LpEULzrhjBI/gbNOyXyYMX4J].\sThe\snon-functionality\sof\sbuttons\s4\sand\s5\son\sWindows\swas\smore\srecently\smentioned\sin\sdiscussions\sregarding\sTIP\s#474.\r\n\r\n\r\nI\sbelieve\ssupport\sfor\sthese\sbuttons\scan\sbe\sadded\sto\s8.6,\sand\snot\shave\sto\swait\sfor\s8.7.\sThere\sis\sindeed\sa\slikelihood\sthat\sexisting\sprograms\sbind\sto\sbuttons\s4\sand\s5\sto\sallow\sscrolling\son\sX11,\syet\sfail\sto\srestrict\sthose\sbindings\sto\swhen\s[tk\swindowingsystem]\sis\s"x11";\showever,\sthose\sprograms\salready\sexhibit\sthis\sissue\son\sAqua.\s(I\sinformed\sthe\sauthor\sof\sTIP\s#474\sthat\stheir\sexisting\simplementation\swould\sexhibit\sthis\sissue.\sEdit:\smaybe\sit\sdoesn't\saffect\sWindows…)\r\n\r\n\r\nThere\sis\sone\sdetail\sin\sthe\simplementation\sI\sam\snot\svery\scertain\sof:\swhether\swparam\sshould\sonly\sbe\sassigned\sMK_XBUTTON1\sor\sMK_XBUTTON2,\srather\sthan\sMAKEWPARAM(MK_XBUTTON1,\sXBUTTON1)\sor\sMAKEWPARAM(MK_XBUTTON2,\sXBUTTON2),\sin\sthe\sfollowing:\r\n
\r\n@@\s-1783,6\s+1787,14\s@@\sTkWinResendEvent(\r\n\s\s\s\s\s\s\s\smsg\s=\sWM_RBUTTONDOWN;\r\n\s\s\s\s\s\s\s\swparam\s=\sMK_RBUTTON;\r\n\s\s\s\s\s\s\s\sbreak;\r\n+\s\s\s\scase\sButton4:\r\n+\s\s\s\s\s\s\smsg\s=\sWM_XBUTTONDOWN;\r\n+\s\s\s\s\s\s\swparam\s=\sMAKEWPARAM(MK_XBUTTON1,\sXBUTTON1);\r\n+\s\s\s\s\s\s\sbreak;\r\n+\s\s\s\scase\sButton5:\r\n+\s\s\s\s\s\s\smsg\s=\sWM_XBUTTONDOWN;\r\n+\s\s\s\s\s\s\swparam\s=\sMAKEWPARAM(MK_XBUTTON2,\sXBUTTON2);\r\n+\s\s\s\s\s\s\sbreak;\r\n\s\s\s\s\sdefault:\r\n\s\s\s\s\s\s\s\sreturn\s0;\r\n\s\s\s\s\s}\r\n
\r\n\r\nI\sdo\snot\sknow\sexactly\swhat\sTkWinResendEvent()\sis\sused\sfor,\sbut\sI\simagine\sthat\sthe\sway\sI\shave\swritten\sthis\sallows\swhatever\sprocessing\sthe\sevent\sto\scheck\swhich\sbutton\sis\spressed\sfrom\sHIWORD(wparam)\s(e.g.\susing\sthe\sGET_XBUTTON_WPARAM(wparam)\smacro),\srather\sthan\sonly\sby\schecking\sfor\sMK_XBUTTON1\sor\sMK_XBUTTON2.\r\n\r\n\r\nOne\sscript\sfor\smanually\stesting\sthis:\r\n\r\n
\r\npackage\srequire\sTk\r\n\r\nlabel\s.l\s-text\s"Click\shere"\s-height\s10\s-width\s30\r\npack\s.l\r\nbind\s.l\s<4>\s{puts\s"Button\s4\sclicked"}\r\nbind\s.l\s<5>\s{puts\s"Button\s5\sclicked"}\r\n
\r\n\r\nTo\stest\sthis\swithout\san\sactual\s5-button\smouse,\sa\stool\sto\semulate\sthe\sbutton\spresses\scan\sbe\sused,\ssuch\sas\sAutoHotKey\swith\sa\sscript\sthat\smaps\skeypresses\sto\sbuttons\s4\sand\s5:\r\n\r\n
\r\nF6::XButton1\r\n\r\nF7::XButton2\r\n
\r\n\r\nI\shave\ssuccessfully\stested\sthis\simplementation\son\sWindows\s10\s1903\sx64,\sbased\son\stop\sof\srecent\score-8-6-branch\s[3e5c0ebb]. J icomment
\sI'm\sa\sbit\sunsure\sabout\sthe\simpact\sof\sthis\simprovement\son\sTIP\s#474,\swhich\sin\sits\simplementation\s(in\sthe\sgeneric\scode,\ssee\s[77c390bae2700c72])\sturns\sbutton-4\sand\sbutton-5\sinto\sa\s<MouseWheel>\sevent.
\r\n\r\nHere's\sthe\sthread\swith\smy\sfeedback\sto\sthe\sauthor\sof\sTIP\s#474,\sfor\sreference:\s[https://sourceforge.net/p/tcl/mailman/message/36628988/]\r\n\r\nThe\sissue\sthat\sI\spredicted,\sand\sobserved\son\sAqua\swhen\strying\sthe\sTIP\s#474\simplementation,\swas\sthat\s<4>\sand\s<5>\swould\sbe\sconverted\sto\s<MouseWheel>,\sand\sno\slonger\sseen\sas\s<4>\sor\s<5>\sby\sthe\sprogram.\sEssentially,\sclicking\sthe\sextra\sbuttons\swould\sbecome\sequivalent\sto\srotating\sthe\sscrollwheel\sby\sone\sor\smore\snotches\son\snon-X11.\sI\sstrongly\ssuspected\sthis\sissue\salso\sapplied\sto\sWindows,\sbut\shad\snot\sconfirmed\sit;\sand\sI\swasn't\syet\saware\sthat\sI\swouldn't\sbe\sable\sto\sconfirm\sit,\sdue\sto\ssupport\sfor\sbuttons\s4\sand\s5\snot\seven\sbeing\simplemented\son\sWindows.\r\n\r\nHowever,\safter\sproperly\strying\sboth\smy\spatch\sand\sthe\sTIP\s#474\simplementation\ssimultaneously,\sI\sdon't\sobserve\sthe\sissue\son\sWindows,\sas\sI\shad\son\sAqua;\sthe\sprogram\sstill\ssees\s<4>\sand\s<5>\sinstead\sof\s<MouseWheel>.\sI\sguess\sthe\sWindows\scode\snever\sgets\sto\sthe\spart\sof\sUpdateButtonEventState()\saffected\sby\sTIP\s#474.\sBut\sit's\sstill\sprobably\sclearer/safer\sto\smake\ssure\sthat\sany\s<4>\sor\s<5>\susage\sin\sgeneric\scode\schecks\sthat\sthe\swindowingsystem\sis\sX11\sif\sthose\sbuttons\sare\sbeing\sused\sfor\sscrolling. J login chrstphrchvz J mimetype text/x-fossil-wiki J username chrstphrchvz K 1fb7af623ac45badc115df0b3515a4e552400508 U chrstphrchvz Z c18996b009605a7f246e148f010af92d