|
1 | | -# Mouse events |
| 1 | +# أحداث الماوس |
2 | 2 |
|
3 | | -In this chapter we'll get into more details about mouse events and their properties. |
| 3 | +في هذا الفصل سنتناول المزيد حول أحداث الماوس وخصائصها. |
4 | 4 |
|
5 | | -Please note: such events may come not only from "mouse devices", but are also from other devices, such as phones and tablets, where they are emulated for compatibility. |
| 5 | +يرجى ملاحظة: هذه الأحداث ليست مقتصرة على "الماوس " ولكن تأتى أيضاً من أجهزة أخرى مثل الهواتف والأجهزة اللوحية، والتى يتم مضاهاتها للتوافق. |
6 | 6 |
|
7 | | -## Mouse event types |
| 7 | +## أنواع أحداث الماوس |
8 | 8 |
|
9 | | -We've already seen some of these events: |
| 9 | +لقد راينا بالفعل بعض هذه الأحداث: |
10 | 10 |
|
11 | 11 | `mousedown/mouseup` |
12 | | -: Mouse button is clicked/released over an element. |
| 12 | + |
| 13 | +:استخدام زر الماوس في النقر / تحرير النقر عن العنصر . |
13 | 14 |
|
14 | 15 | `mouseover/mouseout` |
15 | | -: Mouse pointer comes over/out from an element. |
| 16 | +: تحريك مؤشر الماوس فوق / خارج العنصر. |
16 | 17 |
|
17 | 18 | `mousemove` |
18 | | -: Every mouse move over an element triggers that event. |
| 19 | +: يعمل هذا الحدث فعلياً مع كل حركة لمؤشر الماوس فوق العنصر. |
19 | 20 |
|
20 | 21 | `click` |
21 | | -: Triggers after `mousedown` and then `mouseup` over the same element if the left mouse button was used. |
| 22 | +: يعمل بعد `mousedown`ثم `mouseup` على نفس العنصر بإستخدام الزر الأيسر للماوس. |
22 | 23 |
|
23 | 24 | `dblclick` |
24 | | -: Triggers after two clicks on the same element within a short timeframe. Rarely used nowadays. |
| 25 | +: يعمل بعد النقر مرتين على نفس العنصر خلال فترة زمنية قصيرة. نادرا ما يستخدم في الوقت الحاضر. |
25 | 26 |
|
26 | 27 | `contextmenu` |
27 | | -: Triggers when when the right mouse button is pressed. There are other ways to open a context menu, e.g. using a special keyboard key, it triggers in that case also, so it's not exactly the mouse event. |
28 | 28 |
|
29 | | -...There are several other events too, we'll cover them later. |
| 29 | +:يعمل عندما يتم الضغط على زر الفأرة الأيمن. وهناك طرق أخرى لفتح قائمة السياق ، على سبيل المثال باستخدام مفتاح معين من لوحة المفاتيح ، ويمكن أيضًا استخدامه في هذه الحالة ، لذا فهو ليس بالضبط حدث للماوس . |
| 30 | + |
| 31 | +... وهناك أيضا العديد من الأحداث الأخرى ، واللتى سنتطرق لها لاحقًا |
| 32 | +. |
30 | 33 |
|
31 | | -## Events order |
| 34 | +## نرتيب الأحداث |
32 | 35 |
|
33 | | -As you can see from the list above, a user action may trigger multiple events. |
| 36 | +كما ترى من القائمة السابقة ، قد يقوم إجراء المستخدم بتشغيل أكثر من حدث أو أحداث متعددة |
34 | 37 |
|
35 | | -For instance, a left-button click first triggers `mousedown`, when the button is pressed, then `mouseup` and `click` when it's released. |
36 | 38 |
|
37 | | -In cases when a single action initiates multiple events, their order is fixed. That is, the handlers are called in the order `mousedown` -> `mouseup` -> `click`. |
| 39 | +على سبيل المثال , عند النقر على الزر الايسر فإن أول حدث يتم تشغيله `mousedown`, عند الضغط على الزر, ثم `mouseup` وبالتالي أيضا `click` عند تحرير النقر. |
| 40 | + |
| 41 | +في الحالات التي يبدأ فيها إجراء واحد أحداثًا متعددة ، فإنه يتم إصلاح ترتيبها. بمعنى ، أنه يقوم باستدعاء الأحداث بالترتيب |
| 42 | + `mousedown` -> `mouseup` -> `click`. |
38 | 43 |
|
39 | 44 | ```online |
40 | | -Click the button below and you'll see the events. Try double-click too. |
| 45 | +لمعاينة الأحداث بوضوح أنقر فوق الزر أدناه. جرب النقر مرتين أيضاً. |
| 46 | +
|
| 47 | +في التجربة التالية ، يتم تسجيل جميع أحداث الماوس ، وإذا كان هناك تأخير لأكثر من ثانية واحدة يتم فصلها بخط أفقي متقطع. |
41 | 48 |
|
42 | | -On the teststand below all mouse events are logged, and if there is more than a 1 second delay between them they are separated by a horizontal ruler. |
43 | 49 |
|
44 | | -Also we can see the `button` property that allows to detect the mouse button, it's explained below. |
| 50 | +كما يمكننا أن نرى `button` الذي يسمح لنا باكتشاف زر الماوس ، كما هو موضح أدناه. |
45 | 51 |
|
46 | | -<input onmousedown="return logMouse(event)" onmouseup="return logMouse(event)" onclick="return logMouse(event)" oncontextmenu="return logMouse(event)" ondblclick="return logMouse(event)" value="Click me with the right or the left mouse button" type="button"> <input onclick="logClear('test')" value="Clear" type="button"> <form id="testform" name="testform"> <textarea style="font-size:12px;height:150px;width:360px;"></textarea></form> |
| 52 | +<input onmousedown="return logMouse(event)" onmouseup="return logMouse(event)" onclick="return logMouse(event)" oncontextmenu="return logMouse(event)" ondblclick="return logMouse(event)" value="أنقر فوقي بزر الماوس الايمن أو الأيسر " type="button"> <input onclick="logClear('test')" value="مسح" type="button"> <form id="testform" name="testform"> <textarea style="font-size:12px;height:150px;width:360px;"></textarea></form> |
47 | 53 | ``` |
48 | 54 |
|
49 | | -## Mouse button |
| 55 | +## زر الماوس |
50 | 56 |
|
51 | 57 | Click-related events always have the `button` property, which allows to get the exact mouse button. |
52 | 58 |
|
|
0 commit comments