Very serious problems with some scripting functions

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Very serious problems with some scripting functions

Re: Very serious problems with some scripting functions

by jiri » Fri Jan 02, 2009 6:09 pm

Most of the issues will be addressed in build 1208.

Jiri

Re: Very serious problems with some scripting functions

by ZvezdanD » Sun Dec 28, 2008 7:43 am

Of course that we miss many controls. If you take a look on the Scripting Wishlist thread you could see many requests for them. Yes, the Listbox is mostly missing, but there are also needs for Listview and Treeview controls. But, beside of missing controls there is even more a need for missing properties/methods/events. Please just take a look on my post where I described how I implemented listbox and multilineedit controls using WebBrowser ActiveX and you will see what I need from such controls and why I don't want to use MM3 built-in multilineedit control.

For example, why edit/multilineedit controls don't have a properties SelectStart and SelectEnd to detect which part of the text is selected and to have a possibility to programatically insert some text into a specified location (something which I implemented in the Magic Nodes script using WebBrowser control)? Also, I really need a possibility to set a font for edit/multilineedit controls. Yes, I know this is not consistent with the rest of controls on the form, but I really prefer some monospaced font for editing SQL queries and prefer it to be somewhat bigger than default font.

Another example - Listbox and Dropdown controls could have a property to assign icon/picture to every item in the list (something like Owner Draw Combo and List box controls in some languages). Buttons also could have a property to assign a icon/picture to them, with a possibility to decide if it should be displayed together with the caption or without it, and with the property to specify a relative position to caption - e.g. left to caption or above the caption. Checked listbox and multi-column listbox are also a must if you want to get rid of WebBrowser AcitveX (how else could I replace my HTML tables for export/import in Magic Nodes and replacements in RegExp), but Listview control could be even better for such thing.

Well, if I think even further, I could use Tab Panel control as well, and RichEdit control with a possibility to have different text foregrounds/backgrounds (I need it if I want to implement context highlighting for SQL queries. Hmm, well I already have implemented similar thing with the WebBrowser control within RegExp script, so this is also must for me if I want to eliminate those ActiveXs).

Re: Very serious problems with some scripting functions

by jiri » Sun Dec 28, 2008 5:46 am

Yes, handling of ActiveX controls, particularly keyboard events, isn't perfect. We will try to improve this, but I can't guarantee at this moment any timeframe and how much successful will we be. In any case, we will look into it.

However, I wonder, can't we get rid of most of these ActiveX controls and replace them by our internal controls? This would not only perfectly solve this kind of problems, but it would also make controls nicer (matching user's skin) and probably also faster/less resourse intensive. From the scripts I saw, it seems the we mostly miss a listbox control internally in MM. So my questions are:

1. Do we only miss a listbox, or also anything else?
2. What special features do you need for a listbox? Just basic item handling, focus, etc.? We could quite easily add anything, e.g. multi-column support, etc., but before we do so, I'd like to know what's mostly needed, so that our solution isn't overly complex and hard to use.

Jiri

Re: Very serious problems with some scripting functions

by ZvezdanD » Sat Dec 27, 2008 7:16 pm

jiri wrote:both issues are already fixed at this moment.
Well, this is really nice and I apreciate it. I already tried that with a new MM version and found that you fixed two critical bugs and mentioned that in the Magic Nodes thread. But, what about:
I created one Option sheet in the Options dialog box and put one Web Document ActiveX control at it (SDB.UI.NewActiveX(oSheet, "Shell.Explorer")). When I open the Options dialog box and when I open my options sheet, Web control is showing without problem. But, if I temporarily switch to some another option sheet and turn back to my option sheet, Web control is not showing at all! If I close and reopen the Options dialog box, my Web control is showing again (until I switch to some another options sheet). Same problem have skinned/non-skinned MM2/MM3 versions.

Also, it is irritating that the Tab key not transfers focus to any ActiveX control (tried Web Document and Forms.ListBox). You know, there are some people which prefer the keyboard instead of the mouse.
Here is a text which I sent to Petr with e-mail, but I didn't get any response:
Here is one script file which could demonstrate several issues. The first one is with the Web browser control in the Option sheet:
- enter in the Options dialog box and click on the Test sheet (you could see one Web control on it);
- click on some another sheet;
- click again on the Test sheet -> it is now empty without the Web control;
- close and open again the Options dialog -> Web control is again here until you choose some another sheet.

The several issues are with the ActiveX controls and its focus. Here is the first one:
- choose Edit / Zvezdan's Test 3;
- press the Tab key several times -> focus is transferring between MM built-in controls as it should, until you come to the Web control which cannot get focus.

This means that when you are tabbed to the Web control which has SELECT element (listbox), the Up/Down keys transfers focus to the next MM control instead to change items in this list. Similarly, if you are tabbed to the Web control which has TEXTAREA element (multi-line edit box), none keys are accepted (i.e. typed in that control) except arrows keys which are transferring focus to the next MM control.

The second issue is related to the previous:
- in the same dialog box click on some MM control, i.e. set focus to it;
- click on the Web control which has listbox -> focus is not transfered to it;
- click on the same Web control again -> focus is now accepted;

If you click on some another Web control and after that click on the previous Web control with the listbox -> the focus is immediately accepted, but if you click on some MM control and after that click on the Web control with the listbox -> the focus is transfered only after second click.

If you select some item from this listbox, then click on some MM control and after that click on same listbox again -> the focus is transfered just after third click!

OK, this is not so serious because I could go around with this issue using the "<body onmousedown = 'this.focus();'>" (lines 75 and 108). Interestingly enough, this issue is only with the skinned MM version, all other issues are manifesting with both versions.

The next issue is with the Web control which has TEXTAREA:
- in the same dialog box click on the text field next to the Filter label;
- type several characters, just to be sure it accepts characters;
- press up or down arrow keys -> the focus is transfered to the next MM control.

If you type several lines of text, when you press up or down keys they are functioning as they should only in the middle of the text, but if you press the up arrow key when you are on the first line of the text, or if you press the down arrow key when you are on the last line of the text -> the Web control is loosing focus. I think this is so unusual because the focus should stay in the same control.

Luckily, I could go around with this issue as well with several lines of code (from the line 143).

Well, you could say that I need to do similar thing when I want to get focus when I am tabbing with the Tab key, but I cannot do this because the Web control never generate OnFocus event (tried that with the line 69 and the corresponding function).

This problem is not only with the Web control, but the same thing is with the Listbox control, if you have installed and registered Forms ActiveX (the line 168). When you come to it with the Tab key, it cannot accept up/down arrow keys, but they are transferring focus to another MM control. Interestingly, the textbox control from the Forms ActiveX (the line 187) has not a problems with the Tab key and up/down arrow keys.

One more question - why the mouse cursor is changing to the application hourglass when the mouse is over the scroll bar or the border of the Web control with the SELECT element (listbox)? I tried to set the cursor parameter for the SELECT style without any success. I noticed similar thing with the Textbox control from the Forms ActiveX when the cursor is changing between the default (pointer) shape and I-beam shape as you move the mouse over the text.

Some not so important questions - why the width and the height is not accepted when you use oCtrl.Common.SetRect on the listbox from the Forms controls? Instead, I need to use oCtrl.Common.Width and oCtrl.Common.Height after oCtrl.Interf.BorderStyle = 1. Why the font setting of the textbox of Forms control (the line 190 - oCtrl.Interf.FontName = "System") has such strange effect? Just try to type some text inside of it and you will see what I mean (the every second character has default font).

Regards,
Zvezdan
Here is a script which was attached:

Code: Select all

Sub OnStartUp()
    Dim mnuTest

    Set mnuTest = SDB.UI.AddMenuItem(SDB.UI.Menu_Edit, 0, 0)
    mnuTest.Caption = "Zvezdan's Test 3"
    mnuTest.OnClickFunc = "TestForm"
    mnuTest.UseScript = Script.ScriptPath

    Call SDB.UI.AddOptionSheet("Test sheet", _
            Script.ScriptPath, "InitOptionSheet", "SaveOptionSheet", -1)
End Sub

Sub InitOptionSheet(oSheet)
    Dim wbtMasks, sWebTbl

    Set wbtMasks = SDB.UI.NewActiveX(oSheet, "Shell.Explorer")
    wbtMasks.Common.SetRect 10, 10, 460, 188

    sWebTbl = "<html><head><style type='text/css'>body {margin: 2px} " & _
            "table {font: 11px 'tahoma' 'sans-serif'}</style></head>"
    sWebTbl = sWebTbl & "<body><table cellspacing='2'><thead>" & _
            "<tr bgcolor='Silver'><td width='4%'>" & _
            "<input type='checkbox' name='chk0' "
    sWebTbl = sWebTbl & "/></td><td width='4%'>#</td><td>Masks from "
    sWebTbl = sWebTbl & "</td></tr></thead><tbody>"
    sWebTbl = sWebTbl & "</tbody></table></body></html>"
    wbtMasks.SetHTMLDocument sWebTbl
End Sub

Sub SaveOptionSheet(oSheet)

End Sub

Sub TestForm(Item)
    Dim Form, oCtrl, sTmp, i

    Set Form = SDB.UI.NewForm
    Form.Common.SetRect 100, 100, 578, 546
    Form.BorderStyle = 3
    Form.FormPosition = 4
    Form.Caption = "Zvezdan's Test 3"

    Set oCtrl = SDB.UI.NewLabel(Form)
    oCtrl.Caption = "Position:"
    oCtrl.Common.SetRect 10, 41, 53, 17

    Set oCtrl = SDB.UI.NewDropDown(Form)
    oCtrl.Style = csDropDownList
    oCtrl.Common.SetRect 66, 38, 81, 21

    Set oCtrl = SDB.UI.NewDropDown(Form)
    oCtrl.Style = csDropDownList
    oCtrl.Common.SetRect 154, 38, 90, 21

    Set oCtrl = SDB.UI.NewLabel(Form)
    oCtrl.Caption = "Shortcut:"
    oCtrl.Common.SetRect 426, 41, 53, 17

    Set oCtrl = SDB.UI.NewEdit(Form)
    oCtrl.Common.SetRect 487, 38, 73, 17

    Set oCtrl = SDB.UI.NewRadioButton(Form)
    oCtrl.Caption = "Field:"
    oCtrl.Common.SetRect 10, 74, 53, 17
    oCtrl.Checked = True

    Set oCtrl = SDB.UI.NewActiveX(Form, "Shell.Explorer")
    oCtrl.Common.SetRect 66, 75, 137, 71
    'Script.RegisterEvent oCtrl.Interf.Document, "onFocus", "lstNodes_OnFocus"
    sTmp = "<html><head><style type='text/css'>" _
            & "body {margin: 0px 0px; overflow: hidden; border: none} " _
            & "select {font: 11px 'tahoma' 'sans-serif'; margin: 0px 0px;" _
            & " width: 137px; height: 71px}" _
            & "</style></head><body"
    'sTmp = sTmp & " onmousedown = 'this.focus();'" ' Because of MM bug
    sTmp = sTmp & "><select size = '100'></select></body></html>"
    oCtrl.SetHTMLDocument sTmp
    For i = 0 To 10
        ListBoxAddItem oCtrl, i
    Next

    Set oCtrl = SDB.UI.NewRadioButton(Form)
    oCtrl.Caption = "Group:"
    oCtrl.Common.SetRect 10, 152, 53, 17

    Set oCtrl = SDB.UI.NewDropDown(Form)
    oCtrl.Common.SetRect 66, 151, 137, 21

    Set oCtrl = SDB.UI.NewLabel(Form)
    oCtrl.Caption = "Nodes:"
    oCtrl.Common.SetRect 213, 76, 40, 17

    Set oCtrl = SDB.UI.NewButton(Form)
    oCtrl.Caption = "Add"
    oCtrl.Common.SetRect 212, 96, 33, 22

    Set oCtrl = SDB.UI.NewButton(Form)
    oCtrl.Caption = "Del"
    oCtrl.Common.SetRect 212, 121, 33, 22

    Set oCtrl = SDB.UI.NewActiveX(Form, "Shell.Explorer")
    oCtrl.Common.SetRect 255, 75, 154, 97
    sTmp = "<html><head><style type='text/css'>" _
            & "body {margin: 0px 0px; overflow: hidden; border: none} " _
            & "select {font: 11px 'tahoma' 'sans-serif'; margin: 0px 0px;" _
            & " width: 154px; height: 97px}" _
            & "</style></head><body"
    'sTmp = sTmp & " onmousedown = 'this.focus();'" ' Because of MM bug
    sTmp = sTmp & "><select size = '100'></select></body></html>"
    oCtrl.SetHTMLDocument sTmp
    For i = 0 To 10
        ListBoxAddItem oCtrl, i
    Next

    Set oCtrl = SDB.UI.NewCheckBox(Form)
    oCtrl.Caption = "Show [Unknown] node"
    oCtrl.Common.SetRect 420, 75, 129, 17

    Set oCtrl = SDB.UI.NewCheckBox(Form)
    oCtrl.Caption = "Show [All] node"
    oCtrl.Common.SetRect 420, 95, 97, 17

    Set oCtrl = SDB.UI.NewCheckBox(Form)
    oCtrl.Caption = "Show tracks in tracklist"
    oCtrl.Common.SetRect 420, 115, 129, 17

    Set oCtrl = SDB.UI.NewLabel(Form)
    oCtrl.Caption = "Filter:"
    oCtrl.Common.SetRect 10, 209, 53, 17

    Set oCtrl = SDB.UI.NewActiveX(Form, "Shell.Explorer")
    oCtrl.Common.SetRect 66, 209, 454, 50
    sTmp = "<html><head><style type='text/css'>" _
            & "body {margin: 0px 0px; overflow: hidden; border: none} " _
            & "textarea {font: 12px 'courier new' 'serif'; overflow: auto;" _
            & " margin: 0px 0px; border: 1px solid;" _
            & " width: 454px; height: 49px}" _
            & "</style></head>"
    sTmp = sTmp & "<body>"
    ' The next statement is needed instead of previous because of MM bug with
    ' the up/down keys which transfer focus to the other controls on the form
    ' when the textual cursor is on the top/bottom of this control.
'    sTmp = sTmp & "<script type='text/javascript'>var iKeyCode</script>" _
'            & "<body" _
'            & " onkeydown = 'iKeyCode = event.keyCode;'" _
'            & " onkeyup = 'iKeyCode = """";'" _
'            & " onfocusout = 'if(iKeyCode == 38 || iKeyCode == 40)" _
'            & "  event.srcElement.focus();'>"
    sTmp = sTmp & "<textarea></textarea></body></html>"
    oCtrl.SetHTMLDocument sTmp

    Set oCtrl = SDB.UI.NewLabel(Form)
    oCtrl.Caption = "Icon:"
    oCtrl.Common.SetRect 10, 270, 53, 17

    Set oCtrl = SDB.UI.NewDropDown(Form)
    oCtrl.Style = csDropDownList
    oCtrl.Common.SetRect 66, 267, 73, 21

    Set oCtrl = SDB.UI.NewLabel(Form)
    oCtrl.Caption = "Top items:"
    oCtrl.Common.SetRect 151, 270, 75, 17

    Set oCtrl = SDB.UI.NewSpinEdit(Form)
    oCtrl.Common.SetRect 223, 267, 57, 17

    On Error Resume Next
    Set oCtrl = SDB.UI.NewActiveX(Form, "Forms.ListBox.1")
    If Err = 0 Then
        oCtrl.Common.SetRect 66, 300, 130, 130
        oCtrl.Interf.BorderStyle = 1
        oCtrl.Common.Width = 130
        oCtrl.Common.Height = 130
        For i = 0 To 10
            oCtrl.Interf.AddItem i
        Next
    End If

    Set oCtrl = SDB.UI.NewButton(Form)
    oCtrl.Caption = "Add"
    oCtrl.Common.SetRect 220, 300, 33, 22

    Set oCtrl = SDB.UI.NewButton(Form)
    oCtrl.Caption = "Del"
    oCtrl.Common.SetRect 220, 350, 33, 22

    Set oCtrl = SDB.UI.NewActiveX(Form, "Forms.TextBox.1")
    oCtrl.Interf.MultiLine = True
    oCtrl.Interf.ScrollBars = 3
    oCtrl.Interf.FontName = "System" '"Fixedsys"
    oCtrl.Common.SetRect 300, 300, 200, 130

    Set oCtrl = SDB.UI.NewLabel(Form)
    oCtrl.Caption = "Mask:"
    oCtrl.Common.SetRect 10, 448, 53, 17

    Set oCtrl = SDB.UI.NewEdit(Form)
    oCtrl.Common.SetRect 66, 445, 494, 17
    oCtrl.Common.ControlName = "edtMask"

    Set oCtrl = SDB.UI.NewButton(Form)
    oCtrl.Caption = "&OK"
    oCtrl.Common.SetRect 407, 482, 73, 25
    oCtrl.UseScript = Script.ScriptPath
    oCtrl.Default = True
    oCtrl.modalResult = 1
    'Set SDB.Objects("ButtonOK") = oCtrl

    Set oCtrl = SDB.UI.NewButton(Form)
    oCtrl.Caption = "&Cancel"
    oCtrl.Common.SetRect 487, 482, 73, 25
    oCtrl.UseScript = Script.ScriptPath
    oCtrl.Cancel = True
    oCtrl.modalResult = 2

    Form.showModal
    'Set SDB.Objects("ButtonOK") = Nothing
End Sub

Sub ListBoxAddItem(oCtrl, sText)
    Dim oSelect, oOption

    Set oSelect = oCtrl.Interf.Document.getElementsByTagName("select").Item(0)
    Set oOption = oCtrl.Interf.Document.createElement("option")
    oSelect.options.add(oOption)
    oOption.text = sText
End Sub

Sub lstNodes_OnFocus()
    MsgBox "Oh well"
End Sub
And another mail:
Oh, I forgot to mention one more issue...
- click on the listbox from the Forms ActiveX (control below Icon dropdown);
- press up or down arrow keys -> selected item from the list is not changing.

This problem don't have SELECT element of the Web control.

Regards,
Zvezdan
By the way, if you don't have installed Forms ActiveX, you will get error message with this script albeit it has On Error Resume Next before critical lines of code.

I think that after spending so much time trying to detect and resolve such issues, after writing sample scipt and writing such long explanation about test, I deserve to get at least some short information about their status.

Re: Very serious problems with some scripting functions

by jiri » Sat Dec 27, 2008 6:08 pm

Just for completeness of this thread: both issues are already fixed at this moment.

Thanks for the report,
Jiri

Re: Very serious problems with some scripting functions

by ZvezdanD » Sun Nov 16, 2008 9:05 am

I just discovered one more serious bug with some of SDBIniFile functions (Keys, StringValue,...). They are limited to 2048 characters, so if you try to read some key from the .ini file which has more than 2048 chars, MM will return the error message, but in some situations it could simply disapear without any questions. On another side, writing to the .ini file is not limited, so you could use StringValue method to store some key which has more than 2048 characters without any problem. Tried both MM3 and MM2 with same results.

Here is a sample script:

Code: Select all

Sub OnStartUp()
    Dim mnuTest

    Set mnuTest = SDB.UI.AddMenuItem(SDB.UI.Menu_Edit, 0, 0)
    mnuTest.Caption = "Zvezdan's Test 2"
    mnuTest.OnClickFunc = "TestForm"
    mnuTest.UseScript = Script.ScriptPath
End Sub

Dim btnTest1
Dim btnTest2
Dim btnTest3

Sub TestForm(Item)
    Dim Form, i

    Set Form = SDB.UI.NewForm
    Form.Common.SetRect 100, 100, 500, 200
    Form.BorderStyle = 3
    Form.FormPosition = 4
    Form.Caption = "Zvezdan's Test 2"

    Set btnTest1 = SDB.UI.NewButton(Form)
    btnTest1.Caption = "Test with 2048 chars"
    btnTest1.Common.SetRect 10, 10, 200, 22
    Script.RegisterEvent btnTest1, "OnClick", "btnTest1_OnClick"

    Set btnTest2 = SDB.UI.NewButton(Form)
    btnTest2.Caption = "Test with 2050 chars"
    btnTest2.Common.SetRect 10, 50, 200, 22
    Script.RegisterEvent btnTest2, "OnClick", "btnTest2_OnClick"

    Set btnTest3 = SDB.UI.NewButton(Form)
    btnTest3.Caption = "Test with 2052 chars"
    btnTest3.Common.SetRect 10, 90, 200, 22
    Script.RegisterEvent btnTest3, "OnClick", "btnTest3_OnClick"

    SDB.IniFile.DeleteSection "ZvezdanTest"

    Form.showModal
End Sub

Sub btnTest1_OnClick()
    SDB.IniFile.StringValue("ZvezdanTest", "Item1") = String(2048, "Z")
    MsgBox "Ini key with 2048 characters stored succesfully."
    MsgBox "Chars = " & Len(SDB.IniFile.StringValue("ZvezdanTest", "Item1"))
    MsgBox "Items = " & SDB.IniFile.Keys("ZvezdanTest").Count
End Sub

Sub btnTest2_OnClick()
    SDB.IniFile.StringValue("ZvezdanTest", "Item2") = String(2050, "Z")
    MsgBox "Ini key with 2050 characters stored succesfully."
    MsgBox "Chars = " & Len(SDB.IniFile.StringValue("ZvezdanTest", "Item2"))
    MsgBox "Items = " & SDB.IniFile.Keys("ZvezdanTest").Count
End Sub

Sub btnTest3_OnClick()
    SDB.IniFile.StringValue("ZvezdanTest", "Item3") = String(2052, "Z")
    MsgBox "Ini key with 2052 characters stored succesfully."
    MsgBox "Chars = " & Len(SDB.IniFile.StringValue("ZvezdanTest", "Item3"))
    MsgBox "Items = " & SDB.IniFile.Keys("ZvezdanTest").Count
End Sub

Very serious problems with some scripting functions

by ZvezdanD » Sat Nov 15, 2008 10:26 am

I reported some bugs of MediaMonkey in the Scripting forum (some of them are very serious), but it seems to me that MM developers don't visit that forum, so I am now trying here. Same problems existed even year ago when I posted this at: http://www.mediamonkey.com/forum/viewto ... 10#p103510.

Most serious problem is with DropDown lists and their DeleteItem method which leads to 100% CPU and unresponsive program. But, most interesting part is that this not happen with non-skinned version nor with skinned/non-skinned MM 2.x. Here is one sample script which you could try - just put it in Auto folder, restart MM, choose Edit/Zvezdan's Test, scroll dropdown list to its end and select (say) the last item (20). Now, when you click on the Try button you would get unresponsive program. It is very important to select some item from the bottom of this list since this bug is not manifesting if you choose some item from its begin (i.e. items which are visible by default after click on a dropdown arrow).

Code: Select all

Sub OnStartUp()
    Dim mnuTest

    Set mnuTest = SDB.UI.AddMenuItem(SDB.UI.Menu_Edit, 0, 0)
    mnuTest.Caption = "Zvezdan's Test"
    mnuTest.OnClickFunc = "TestForm"
    mnuTest.UseScript = Script.ScriptPath
End Sub

Dim cboTest
Dim btnTest

Sub TestForm(Item)
    Dim Form, i

    Set Form = SDB.UI.NewForm
    Form.Common.SetRect 100, 100, 500, 200
    Form.BorderStyle = 3
    Form.FormPosition = 4
    Form.Caption = "Zvezdan's Test"

    Set cboTest = SDB.UI.NewDropDown(Form)
    cboTest.Common.SetRect 10, 10, 300, 21

    For i = 0 To 20
        cboTest.AddItem i
    Next

    Set btnTest = SDB.UI.NewButton(Form)
    btnTest.Caption = "Try"
    btnTest.Common.SetRect 10, 50, 80, 22
    Script.RegisterEvent btnTest, "OnClick", "btnTest_OnClick"

    Form.showModal
End Sub

Sub btnTest_OnClick()
    Dim i

    i = cboTest.ItemCount - 1
    Do While i >= 0
        cboTest.DeleteItem i
        i = i - 1
    Loop
End Sub
In meantime I noticed one more, not so serious bug. I created one Option sheet in the Options dialog box and put one Web Document ActiveX control at it (SDB.UI.NewActiveX(oSheet, "Shell.Explorer")). When I open the Options dialog box and when I open my options sheet, Web control is showing without problem. But, if I temporarily switch to some another option sheet and turn back to my option sheet, Web control is not showing at all! If I close and reopen the Options dialog box, my Web control is showing again (until I switch to some another options sheet). Same problem have skinned/non-skinned MM2/MM3 versions.

Also, it is irritating that the Tab key not transfers focus to any ActiveX control (tried Web Document and Forms.ListBox). You know, there are some people which prefer the keyboard instead of the mouse. Please, I am not asking about some functionality or missing API calls... This is serious, especially the first problem.

Top